Added feature #16344: htmlArea RTE: New options to configure RTE size/resize
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 11 Nov 2010 04:06:44 +0000 (04:06 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Thu, 11 Nov 2010 04:06:44 +0000 (04:06 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9330 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php
typo3/sysext/rtehtmlarea/ext_tables.php
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js
typo3/sysext/rtehtmlarea/locallang.xml
typo3/sysext/rtehtmlarea/locallang_csh.xml [new file with mode: 0644]
typo3/sysext/rtehtmlarea/pi2/class.tx_rtehtmlarea_pi2.php

index b203a61..c1cff11 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@
 
        * Added feature #8349: htmlArea RTE: Clean paste feature with three options
        * Fixed bug #16327: JS error after feature #16257: Rewrite stylesheets parsing functions (Thanks to Andreas Kiessling)
+       * Added feature #16344: htmlArea RTE: New options to configure RTE size/resize
 
 2010-11-09  Jeff Segars <jeff@webempoweredchurch.org>
 
index 9e9afe6..5678f74 100644 (file)
@@ -1,7 +1,8 @@
 2010-11-10  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Added feature #8349: htmlArea RTE: Clean paste feature with three options
-       * Fixed bug #16327: JS error after feature #16257: Rewrite stylesheets parsing functions (Thanks to Andreas Kiessling ).
+       * Fixed bug #16327: JS error after feature #16257: Rewrite stylesheets parsing functions (Thanks to Andreas Kiessling)
+       * Added feature #16344: htmlArea RTE: New options to configure RTE size/resize
 
 2010-11-08  Stanislas Rolland  <typo3@sjbr.ca>
 
index 2651d10..22171c0 100644 (file)
@@ -330,18 +330,19 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                        $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);
-                       if (isset($this->thisConfig['RTEWidthOverride'])) {
-                               if (strstr($this->thisConfig['RTEWidthOverride'], '%')) {
+                       $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($this->thisConfig['RTEWidthOverride']) > 0) ? $this->thisConfig['RTEWidthOverride'] : '100%';
+                                               $RTEWidth = (intval($RTEWidthOverride) > 0) ? $RTEWidthOverride : '100%';
                                        }
                                } else {
-                                       $RTEWidth = (intval($this->thisConfig['RTEWidthOverride']) > 0) ? intval($this->thisConfig['RTEWidthOverride']) : $RTEWidth;
+                                       $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 = intval($this->thisConfig['RTEHeightOverride']);
+                       $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%';
@@ -803,8 +804,10 @@ class tx_rtehtmlarea_base extends t3lib_rteapi {
                        RTEarea[editornumber].deleted = false;
                        RTEarea[editornumber].textAreaId = "' . $textAreaId . '";
                        RTEarea[editornumber].id = "RTEarea" + editornumber;
-                       RTEarea[editornumber].RTEWidthOverride = "' . trim($this->thisConfig['RTEWidthOverride']) . '";
-                       RTEarea[editornumber].RTEHeightOverride = "' . trim($this->thisConfig['RTEHeightOverride']) . '";
+                       RTEarea[editornumber].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'])) . '";
+                       RTEarea[editornumber].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'])) . '";
+                       RTEarea[editornumber].resizable = ' . ((is_object($GLOBALS['BE_USER']) && isset($GLOBALS['BE_USER']->uc['rteResize']) && $GLOBALS['BE_USER']->uc['rteResize']) ? 'true' : (trim($this->thisConfig['rteResize']) ? 'true' : 'false')) . ';
+                       RTEarea[editornumber].maxHeight = "' . ((is_object($GLOBALS['BE_USER']) && isset($GLOBALS['BE_USER']->uc['rteMaxHeight']) && intval($GLOBALS['BE_USER']->uc['rteMaxHeight'])) ? trim($GLOBALS['BE_USER']->uc['rteMaxHeight']) : (intval($this->thisConfig['rteMaxHeight']) ? intval($this->thisConfig['rteMaxHeight']) : '2000')) . '";
                        RTEarea[editornumber].fullScreen = ' . ($this->fullScreen ? 'true' : 'false') . ';
                        RTEarea[editornumber].showStatusBar = ' . (trim($this->thisConfig['showStatusBar'])?'true':'false') . ';
                        RTEarea[editornumber].enableWordClean = ' . (trim($this->thisConfig['enableWordClean'])?'true':'false') . ';
index 62d870b..aa3f65c 100644 (file)
@@ -24,6 +24,7 @@ if (!defined ('TYPO3_MODE'))  die ('Access denied.');
        t3lib_extMgm::allowTableOnStandardPages('tx_rtehtmlarea_acronym');
 
                // Add contextual help files
+       t3lib_extMgm::addLLrefForTCAdescr('xEXT_' . $_EXTKEY . '_General', 'EXT:' . $_EXTKEY . '/locallang_csh.xml');
        foreach ($TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins'] as $pluginName => $config) {
                if ($config['contextHelpFile']) {
                        t3lib_extMgm::addLLrefForTCAdescr('xEXT_' . $_EXTKEY . '_' . $pluginName, $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins'][$pluginName]['contextHelpFile']);
@@ -35,6 +36,26 @@ if (TYPO3_MODE === 'BE' && t3lib_extMgm::isLoaded('setup') && is_array($GLOBALS[
        $GLOBALS['TYPO3_USER_SETTINGS']['columns'] = array_merge(
                $GLOBALS['TYPO3_USER_SETTINGS']['columns'],
                array(
+                       'rteWidth' => array(
+                               'type' => 'text',
+                               'label' => 'LLL:EXT:rtehtmlarea/locallang.xml:rteWidth',
+                               'csh' => 'xEXT_rtehtmlarea_General:rteWidth',
+                       ),
+                       'rteHeight' => array(
+                               'type' => 'text',
+                               'label' => 'LLL:EXT:rtehtmlarea/locallang.xml:rteHeight',
+                               'csh' => 'xEXT_rtehtmlarea_General:rteHeight',
+                       ),
+                       'rteResize' => array(
+                               'type' => 'check',
+                               'label' => 'LLL:EXT:rtehtmlarea/locallang.xml:rteResize',
+                               'csh' => 'xEXT_rtehtmlarea_General:rteResize',
+                       ),
+                       'rteMaxHeight' => array(
+                               'type' => 'text',
+                               'label' => 'LLL:EXT:rtehtmlarea/locallang.xml:rteMaxHeight',
+                               'csh' => 'xEXT_rtehtmlarea_General:rteMaxHeight',
+                       ),
                        'rteCleanPasteBehaviour' => array(
                                'type' => 'select',
                                'label' => 'LLL:EXT:rtehtmlarea/htmlarea/plugins/PlainText/locallang.xml:rteCleanPasteBehaviour',
@@ -47,6 +68,6 @@ if (TYPO3_MODE === 'BE' && t3lib_extMgm::isLoaded('setup') && is_array($GLOBALS[
                        ),
                )
        );
-       $GLOBALS['TYPO3_USER_SETTINGS']['showitem'] .= ',--div--;LLL:EXT:rtehtmlarea/locallang.xml:rteSettings,rteResize,rteMaxHeight,rteCleanPasteBehaviour';
+       $GLOBALS['TYPO3_USER_SETTINGS']['showitem'] .= ',--div--;LLL:EXT:rtehtmlarea/locallang.xml:rteSettings,rteWidth,rteHeight,rteResize,rteMaxHeight,rteCleanPasteBehaviour';
 }
 ?>
\ No newline at end of file
index 8edd752..a7bea96 100644 (file)
@@ -139,8 +139,6 @@ HTMLArea.Config = function (editorId) {
        this.documentType = '<!DOCTYPE html\r'
                        + '    PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\r'
                        + '    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r';
-       this.resizable = TYPO3.settings.textareaResize;
-       this.maxHeight = TYPO3.settings.textareaMaxHeight;
                // Hold the configuration of buttons and hot keys registered by plugins
        this.buttonsConfig = {};
        this.hotKeyList = {};
index 5e47e20..8bea6ee 100644 (file)
@@ -19,6 +19,8 @@
                        <label index="No font">No font</label>
                        <label index="No size">No font size</label>
                        <label index="rteSettings">Rich Text Editor</label>
+                       <label index="rteWidth">Width of the RTE in pixels or percentage</label>
+                       <label index="rteHeight">Height of the RTE in pixels</label>
                        <label index="rteResize">Make RTE resizable</label>
                        <label index="rteMaxHeight">Maximal height of resizable RTE in pixels</label>
                </languageKey>
diff --git a/typo3/sysext/rtehtmlarea/locallang_csh.xml b/typo3/sysext/rtehtmlarea/locallang_csh.xml
new file mode 100644 (file)
index 0000000..384e37e
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<T3locallang>
+       <meta type="array">
+               <description>CSH for htmlArea RTE</description>
+               <type>CSH</type>
+               <csh_table>xEXT_rtehtmlarea_General</csh_table>
+       </meta>
+       <data type="array">
+               <languageKey index="default" type="array">
+                       <label index=".alttitle">htmlArea RTE</label>
+                       <label index=".description">htmlArea RTE is a free, open-source, ExtJS-based editor for &lt;textarea&gt; fields featuring tight integration with TYPO3.</label>
+                       <label index=".details">htmlArea RTE supports the following browsers: Firefox 1.5+, SeaMonkey 1.0+, Safari 3.0.4+, Google Chrome 1.0+ and Opera 9.62+ on any platform, and Internet Explorer 6.0+ on Windows.</label>
+                       <label index=".seeAlso">xEXT_rtehtmlarea_General:beUserSettings,xEXT_rtehtmlarea_PlainText,xEXT_rtehtmlarea_RemoveFormat</label>
+                       <label index="beUserSettings.alttitle">BE User settings</label>
+                       <label index="beUserSettings.description">BE User settings let you specify some options of the RTE.</label>
+                       <label index="beUserSettings.seeAlso">xEXT_rtehtmlarea_General:rteWidth,xEXT_rtehtmlarea_General:rteHeight,xEXT_rtehtmlarea_General:rteResize,xEXT_rtehtmlarea_General:rteMaxHeight,xEXT_rtehtmlarea_PlainText:behaviour,_MOD_user_setup</label>
+                       <label index="rteWidth.alttitle">Default width of the RTE in px or %</label>
+                       <label index="rteWidth.description">This option lets you specify the initial width of the RTE.</label>
+                       <label index="rteWidth.details">The option specifies the width of the RTE when it is initially displayed. The width may be specified as a fixed number of pixels or as a percentage.</label>
+                       <label index="rteHeight.alttitle">Default height of the RTE in px</label>
+                       <label index="rteHeight.description">This option lets you specify the initial height of the RTE.</label>
+                       <label index="rteHeight.details">The option specifies the height of the RTE when it is initially displayed. The height of the RTE must be specified as a fixed number of pixels not as a percentage.
+The value you set should allow sufficient height for the tool bar, the editing area and the status bar of the RTE.</label>
+                       <label index="rteResize.alttitle">Make RTE resizable</label>
+                       <label index="rteResize.description">This option will make RTE-enabled fields resizable. A resize handle will appear at the bottom right corner of the RTE.</label>
+                       <label index="rteMaxHeight.alttitle">Maximal height of resizable RTE in pixels</label>
+                       <label index="rteMaxHeight.description">The value you set should allow sufficient height for the tool bar, the editing area and the status bar of the RTE. Default value is 2000.</label>
+               </languageKey>
+       </data>
+</T3locallang>
index 3a241cc..d102e94 100644 (file)
@@ -224,11 +224,6 @@ class tx_rtehtmlarea_pi2 extends tx_rtehtmlarea_base {
                        $this->TCEform->additionalJS_pre['rtehtmlarea-loadJScode'] = $this->wrapCDATA($this->loadJScode($this->TCEform->RTEcounter));
                }
                $this->TCEform->additionalJS_initial = $this->loadJSfiles($this->TCEform->RTEcounter);
-               $resizableSettings = array(
-                       'textareaResize' => true,
-                       'textareaMaxHeight' => '600'
-               );
-               $pageRenderer->addInlineSettingArray('', $resizableSettings);
                if ($GLOBALS['TSFE']->isINTincScript()) {
                        $GLOBALS['TSFE']->additionalHeaderData['rtehtmlarea'] = $pageRenderer->render();
                }