* Modified typo3/sysext/cms/tslib/class.tslib_content.php:
[Packages/TYPO3.CMS.git] / typo3 / wizard_rte.php
index e0bd429..1f5ba73 100755 (executable)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *  
-*  (c) 1999-2003 Kasper Skaarhoj (kasper@typo3.com)
+*  (c) 1999-2004 Kasper Skaarhoj (kasper@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is 
@@ -72,7 +72,7 @@ t3lib_BEfunc::lockRecords();
 
 /**
  * Script Class for rendering the full screen RTE display
- * 
+ *
  * @author     Kasper Skaarhoj <kasper@typo3.com>
  * @package TYPO3
  * @subpackage core
@@ -92,15 +92,15 @@ class SC_wizard_rte {
 
        /**
         * Initialization of the class
-        * 
-        * @return      void            
+        *
+        * @return      void
         */
        function init() {
                global $BACK_PATH;
 
                        // Setting GPvars:
-               $this->P = t3lib_div::GPvar('P',1);
-               $this->popView = t3lib_div::GPVar('popView');
+               $this->P = t3lib_div::_GP('P');
+               $this->popView = t3lib_div::_GP('popView');
 
                        // "Module name":
                $this->MCONF['name']='xMOD_wizard_rte.php';             
@@ -116,8 +116,8 @@ class SC_wizard_rte {
 
        /**
         * Main function, rendering the document with the iframe with the RTE in.
-        * 
-        * @return      void            
+        *
+        * @return      void
         */
        function main() {
                global $BE_USER,$LANG;
@@ -150,9 +150,15 @@ class SC_wizard_rte {
                        $tceforms = t3lib_div::makeInstance('t3lib_TCEforms');
                        $tceforms->initDefaultBEMode(); // Init...
                        $tceforms->disableWizards = 1;  // SPECIAL: Disables all wizards - we are NOT going to need them.
-                       $tceforms->RTEdivStyle = 'position:relative; left:0px; top:0px; height:100%; width:100%; border:solid 0px;';    // SPECIAL: Setting style for the RTE <DIV> layer containing the IFRAME
                        $tceforms->colorScheme[0]=$this->doc->bgColor;  // SPECIAL: Setting background color of the RTE to ordinary background
-               
+
+                               // Initialize style for RTE object:
+                       $RTEobj = &t3lib_BEfunc::RTEgetObj();   // Getting reference to the RTE object used to render the field!
+                       if ($RTEobj->ID == 'rte')       {
+                               $RTEobj->RTEdivStyle = 'position:relative; left:0px; top:0px; height:100%; width:100%; border:solid 0px;';      // SPECIAL: Setting style for the RTE <DIV> layer containing the IFRAME
+       #                       $RTEobj->RTEdivStyle = 'position:relative; left:0px; top:0px; height:600px; width:100%; border:solid 0px;';     // SPECIAL: Setting style for the RTE <DIV> layer containing the IFRAME
+                       }
+
                                // Fetching content of record:
                        $trData = t3lib_div::makeInstance('t3lib_transferData');
                        $trData->lockRecords=1;
@@ -169,11 +175,10 @@ class SC_wizard_rte {
                        $R_URI=t3lib_div::linkThisScript(array('popView'=>''));
                
                                // Getting settings for the undo button:
-                       $undoButton=0;
-                       $undoQuery='SELECT tstamp FROM sys_history WHERE tablename="'.addslashes($this->P['table']).'" AND recuid="'.addslashes($this->P['uid']).'" ORDER BY tstamp DESC LIMIT 1';
-                       $undoRes = mysql(TYPO3_db,$undoQuery);
-                       if ($undoButtonR = mysql_fetch_assoc($undoRes)) {
-                               $undoButton=1;
+                       $undoButton = 0;
+                       $undoRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tstamp', 'sys_history', 'tablename="'.$GLOBALS['TYPO3_DB']->quoteStr($this->P['table'], 'sys_history').'" AND recuid="'.$GLOBALS['TYPO3_DB']->quoteStr($this->P['uid'], 'sys_history').'"', '', 'tstamp DESC', '1');
+                       if ($undoButtonR = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($undoRes))     {
+                               $undoButton = 1;
                        }
                
                                // ShortCut
@@ -233,14 +238,14 @@ class SC_wizard_rte {
                        <!--
                                RTE wizard:
                        -->
-                               <table border="0" cellpadding="0" cellspacing="0" width="'.$width.'" height="98%" id="typo3-rtewizard">
+                               <table border="0" cellpadding="0" cellspacing="0" width="'.$width.'" id="typo3-rtewizard">
                                        <tr>
                                                <td>'.$panel.'</td>
                                                <td align="right">'.$sCut.'</td>
                                                <td></td>
                                        </tr>
-                                       <tr height="98%">
-                                               <td width="'.$width.'" colspan="2">'.$formContent.'</td>
+                                       <tr>
+                                               <td width="'.$width.'" colspan="2" id="c-formContent">'.$formContent.'</td>
                                                <td></td>
                                        </tr>
                                </table>';
@@ -267,8 +272,8 @@ class SC_wizard_rte {
 
        /**
         * Outputting the accumulated content to screen
-        * 
-        * @return      void            
+        *
+        * @return      void
         */
        function printContent() {
                echo $this->content;
@@ -296,4 +301,4 @@ $SOBE = t3lib_div::makeInstance('SC_wizard_rte');
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
-?>
\ No newline at end of file
+?>