Fixed bug #11899: Make resizable and flexible textareas configurable, set default...
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_tceforms.php
index 5de957b..9be12fe 100644 (file)
@@ -5246,9 +5246,21 @@ class t3lib_TCEforms     {
 
                        $GLOBALS['SOBE']->doc->loadPrototype();
                        $GLOBALS['SOBE']->doc->loadExtJS();
-                       $GLOBALS['SOBE']->doc->addStyleSheet('ext.resizable', $this->backPath . '../t3lib/js/extjs/ux/resize.css');
+
+                               // make textareas resizable and flexible
+                       if (!($GLOBALS['BE_USER']->uc['resizeTextareas'] == '0' && $GLOBALS['BE_USER']->uc['resizeTextareas_Flexible'] == '0')) {
+                               $GLOBALS['SOBE']->doc->addStyleSheet('ext.resizable', $this->backPath . '../t3lib/js/extjs/ux/resize.css');
+                               $this->loadJavascriptLib('../t3lib/js/extjs/ux/ext.resizable.js');
+                       }
+                       $resizableSettings = array(
+                               'textareaMaxHeight' => $GLOBALS['BE_USER']->uc['resizeTextareas_MaxHeight'] >0 ? $GLOBALS['BE_USER']->uc['resizeTextareas_MaxHeight'] : '600',
+                               'textareaFlexible' => (!$GLOBALS['BE_USER']->uc['resizeTextareas_Flexible'] == '0'),
+                               'textareaResize' => (!$GLOBALS['BE_USER']->uc['resizeTextareas'] == '0'),
+                       );
+                       $GLOBALS['SOBE']->doc->addInlineSettingArray('', $resizableSettings);
+
                        $this->loadJavascriptLib('../t3lib/jsfunc.evalfield.js');
-                       $this->loadJavascriptLib('../t3lib/js/extjs/ux/ext.resizable.js');
+
                        // @TODO: Change to loadJavascriptLib(), but fix "TS = new typoScript()" issue first - see bug #9494
                        $jsFile[] = '<script type="text/javascript" src="'.$this->backPath.'jsfunc.tbe_editor.js"></script>';
 
@@ -5258,9 +5270,7 @@ class t3lib_TCEforms      {
                                'dateFormat'       => array('j-n-Y', 'G:i j-n-Y'),
                                'dateFormatUS'     => array('n-j-Y', 'G:i n-j-Y'),
                        );
-                       $out .= '
-                       Ext.ns("TYPO3");
-                       TYPO3.settings = ' . json_encode($typo3Settings) . ';';
+                       $GLOBALS['SOBE']->doc->addInlineSettingArray('', $typo3Settings);
 
                        $this->loadJavascriptLib('../t3lib/js/extjs/tceforms.js');