* Modified typo3/sysext/cms/tslib/class.tslib_content.php:
[Packages/TYPO3.CMS.git] / typo3 / wizard_rte.php
index 2dab980..1f5ba73 100755 (executable)
@@ -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,10 +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->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
                        $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;
@@ -170,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
@@ -268,8 +272,8 @@ class SC_wizard_rte {
 
        /**
         * Outputting the accumulated content to screen
-        * 
-        * @return      void            
+        *
+        * @return      void
         */
        function printContent() {
                echo $this->content;
@@ -297,4 +301,4 @@ $SOBE = t3lib_div::makeInstance('SC_wizard_rte');
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
-?>
\ No newline at end of file
+?>