Follow-up to issue #17677: htmlArea RTE: Classes configuration is loaded twice
authorstan <stan@709f56b5-9817-0410-a4d7-c38de5d9e867>
Sun, 20 Feb 2011 19:50:19 +0000 (19:50 +0000)
committerstan <stan@709f56b5-9817-0410-a4d7-c38de5d9e867>
Sun, 20 Feb 2011 19:50:19 +0000 (19:50 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10507 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php

index 0f85a67..b55d09a 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-02-20  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Follow-up to issue #17677: htmlArea RTE: Classes configuration is loaded twice
+
 2011-02-20  Jigal van Hemert  <jigal@xs4all.nl>
 
        * Fixed bug #17498: The refresh login dialogue is shown even if the session already timed out (Thanks to Helmut Hummel)
index a00e1b3..3b7be02 100644 (file)
@@ -1,3 +1,7 @@
+2011-02-20  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Follow-up to issue #17677: htmlArea RTE: Classes configuration is loaded twice 
+
 2011-02-19  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Fixed bug #17676: htmlArea RTE: Some combo stores are loaded twice
index 96aeb25..cd05979 100644 (file)
@@ -344,29 +344,37 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                         * SET STYLES
                         * =======================================
                         */
-
-                       $RTEWidth = isset($BE_USER->userTS['options.']['RTESmallWidth']) ? $BE_USER->userTS['options.']['RTESmallWidth'] : '530';
-                       $RTEHeight = isset($BE_USER->userTS['options.']['RTESmallHeight']) ? $BE_USER->userTS['options.']['RTESmallHeight'] : '380';
-                       $RTEWidth  = $RTEWidth + ($this->TCEform->docLarge ? (isset($BE_USER->userTS['options.']['RTELargeWidthIncrement']) ? $BE_USER->userTS['options.']['RTELargeWidthIncrement'] : '150') : 0);
-                       $RTEWidth -= ($inline->getStructureDepth() > 0 ? ($inline->getStructureDepth()+1)*$inline->getLevelMargin() : 0);
-                       $RTEWidthOverride = (is_object($GLOBALS['BE_USER']) && isset($GLOBALS['BE_USER']->uc['rteWidth']) && trim($GLOBALS['BE_USER']->uc['rteWidth'])) ? trim($GLOBALS['BE_USER']->uc['rteWidth']) : trim($this->thisConfig['RTEWidthOverride']);
-                       if ($RTEWidthOverride) {
-                               if (strstr($RTEWidthOverride, '%')) {
-                                       if ($this->client['browser'] != 'msie') {
-                                               $RTEWidth = (intval($RTEWidthOverride) > 0) ? $RTEWidthOverride : '100%';
+                               // Check if wizard_rte called this for fullscreen edtition
+                       if (basename(PATH_thisScript) == 'wizard_rte.php') {
+                               $this->fullScreen = TRUE;
+                               $RTEWidth = '100%';
+                               $RTEHeight = '100%';
+                               $RTEPaddingRight = '0';
+                               $editorWrapWidth = '100%';
+                       } else {
+                               $RTEWidth = isset($BE_USER->userTS['options.']['RTESmallWidth']) ? $BE_USER->userTS['options.']['RTESmallWidth'] : '530';
+                               $RTEHeight = isset($BE_USER->userTS['options.']['RTESmallHeight']) ? $BE_USER->userTS['options.']['RTESmallHeight'] : '380';
+                               $RTEWidth  = $RTEWidth + ($this->TCEform->docLarge ? (isset($BE_USER->userTS['options.']['RTELargeWidthIncrement']) ? $BE_USER->userTS['options.']['RTELargeWidthIncrement'] : '150') : 0);
+                               $RTEWidth -= ($inline->getStructureDepth() > 0 ? ($inline->getStructureDepth()+1)*$inline->getLevelMargin() : 0);
+                               $RTEWidthOverride = (is_object($GLOBALS['BE_USER']) && isset($GLOBALS['BE_USER']->uc['rteWidth']) && trim($GLOBALS['BE_USER']->uc['rteWidth'])) ? trim($GLOBALS['BE_USER']->uc['rteWidth']) : trim($this->thisConfig['RTEWidthOverride']);
+                               if ($RTEWidthOverride) {
+                                       if (strstr($RTEWidthOverride, '%')) {
+                                               if ($this->client['browser'] != 'msie') {
+                                                       $RTEWidth = (intval($RTEWidthOverride) > 0) ? $RTEWidthOverride : '100%';
+                                               }
+                                       } else {
+                                               $RTEWidth = (intval($RTEWidthOverride) > 0) ? intval($RTEWidthOverride) : $RTEWidth;
                                        }
-                               } else {
-                                       $RTEWidth = (intval($RTEWidthOverride) > 0) ? intval($RTEWidthOverride) : $RTEWidth;
                                }
+                               $RTEWidth = strstr($RTEWidth, '%') ? $RTEWidth :  $RTEWidth . 'px';
+                               $RTEHeight = $RTEHeight + ($this->TCEform->docLarge ?  (isset($BE_USER->userTS['options.']['RTELargeHeightIncrement']) ? $BE_USER->userTS['options.']['RTELargeHeightIncrement'] : 0) : 0);
+                               $RTEHeightOverride = (is_object($GLOBALS['BE_USER']) && isset($GLOBALS['BE_USER']->uc['rteHeight']) && intval($GLOBALS['BE_USER']->uc['rteHeight'])) ? intval($GLOBALS['BE_USER']->uc['rteHeight']) : intval($this->thisConfig['RTEHeightOverride']);
+                               $RTEHeight = ($RTEHeightOverride > 0) ? $RTEHeightOverride : $RTEHeight;
+                               $RTEPaddingRight = '2px';
+                               $editorWrapWidth = '99%';
                        }
-                       $RTEWidth = strstr($RTEWidth, '%') ? $RTEWidth :  $RTEWidth . 'px';
-                       $RTEHeight = $RTEHeight + ($this->TCEform->docLarge ?  (isset($BE_USER->userTS['options.']['RTELargeHeightIncrement']) ? $BE_USER->userTS['options.']['RTELargeHeightIncrement'] : 0) : 0);
-                       $RTEHeightOverride = (is_object($GLOBALS['BE_USER']) && isset($GLOBALS['BE_USER']->uc['rteHeight']) && intval($GLOBALS['BE_USER']->uc['rteHeight'])) ? intval($GLOBALS['BE_USER']->uc['rteHeight']) : intval($this->thisConfig['RTEHeightOverride']);
-                       $RTEHeight = ($RTEHeightOverride > 0) ? $RTEHeightOverride : $RTEHeight;
-                       $editorWrapWidth = '99%';
                        $editorWrapHeight = '100%';
-                       $this->RTEdivStyle = 'position:relative; left:0px; top:0px; height:' . $RTEHeight . 'px; width:'.$RTEWidth.'; border: 1px solid black; padding: 2px 2px 2px 2px;';
-
+                       $this->RTEdivStyle = 'position:relative; left:0px; top:0px; height:' . $RTEHeight . 'px; width:' . $RTEWidth . '; border: 1px solid black; padding: 2px ' . $RTEPaddingRight . ' 2px 2px;';
                        /* =======================================
                         * LOAD CSS AND JAVASCRIPT
                         * =======================================
@@ -408,13 +416,6 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                                        $value = $plugin->transformContent($value);
                                }
                        }
-                               // Check if wizard_rte called this for fullscreen edtition; if so, change the size of the RTE to fullscreen using JS
-                       if (basename(PATH_thisScript) == 'wizard_rte.php') {
-                               $this->fullScreen = true;
-                               $editorWrapWidth = '100%';
-                               $editorWrapHeight = '100%';
-                               $this->RTEdivStyle = 'position:relative; left:0px; top:0px; height:100%; width:100%; border: 1px solid black; padding: 2px 0px 2px 2px;';
-                       }
                                // Draw the textarea
                        $visibility = 'hidden';
                        $item = $this->triggerField($PA['itemFormElName']).'