Fixed bug #9497: Edit in Rich Text Editor - Button does not work anymore in Web>Page...
authorMichael Stucki <michael.stucki@typo3.org>
Sun, 19 Oct 2008 12:33:32 +0000 (12:33 +0000)
committerMichael Stucki <michael.stucki@typo3.org>
Sun, 19 Oct 2008 12:33:32 +0000 (12:33 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@4327 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tceforms.php
typo3/alt_palette.php

index 9ea7758..621af6d 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-10-19  Michael Stucki  <michael@typo3.org>
+
+       * Fixed bug #9497: Edit in Rich Text Editor - Button does not work anymore in Web>Page (patch by Oliver Hader)
+
 2008-10-18  Dmitry Dulepov  <dmitry@typo3.org>
 
        * Fixed bug #9480: Enhance debug information with SQL data (thanks to Francois Suter for the inspiration)
index 03066a2..252154b 100755 (executable)
@@ -5046,6 +5046,7 @@ class t3lib_TCEforms      {
         * @return      string          A section with JavaScript - if $update is false, embedded in <script></script>
         */
        function JSbottom($formname='forms[0]', $update = false)        {
+               $jsFile = array();
                $elements = array();
 
                        // required:
@@ -5075,17 +5076,18 @@ class t3lib_TCEforms    {
 
                if (!$update) {
                        if ($this->loadMD5_JS) {
-                               $GLOBALS['TBE_TEMPLATE']->loadJavascriptLib('md5.js');
+                               $GLOBALS['SOBE']->doc->loadJavascriptLib('md5.js');
                        }
 
-                       $GLOBALS['TBE_TEMPLATE']->loadJavascriptLib('contrib/prototype/prototype.js');
-                       $GLOBALS['TBE_TEMPLATE']->loadJavascriptLib('../t3lib/jsfunc.evalfield.js');
-                       $GLOBALS['TBE_TEMPLATE']->loadJavascriptLib('jsfunc.tbe_editor.js');
+                       $GLOBALS['SOBE']->doc->loadJavascriptLib('contrib/prototype/prototype.js');
+                       $GLOBALS['SOBE']->doc->loadJavascriptLib('../t3lib/jsfunc.evalfield.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>';
 
                                // if IRRE fields were processed, add the JavaScript functions:
                        if ($this->inline->inlineCount) {
-                               $GLOBALS['TBE_TEMPLATE']->loadJavascriptLib('contrib/scriptaculous/scriptaculous.js');
-                               $GLOBALS['TBE_TEMPLATE']->loadJavascriptLib('../t3lib/jsfunc.inline.js');
+                               $GLOBALS['SOBE']->doc->loadJavascriptLib('contrib/scriptaculous/scriptaculous.js');
+                               $GLOBALS['SOBE']->doc->loadJavascriptLib('../t3lib/jsfunc.inline.js');
                                $out .= '
                                inline.setPrependFormFieldNames("'.$this->inline->prependNaming.'");
                                inline.setNoTitleString("'.addslashes(t3lib_BEfunc::getNoRecordTitle(true)).'");
@@ -5218,7 +5220,8 @@ class t3lib_TCEforms      {
 
                        // Regular direct output:
                if (!$update) {
-                       $out  = chr(10) . chr(9) . t3lib_div::wrapJS($out);
+                       $spacer = chr(10) . chr(9);
+                       $out  = $spacer . implode($spacer, $jsFile) . t3lib_div::wrapJS($out);
                }
 
                return $out;
index 483057e..3941cdc 100755 (executable)
@@ -300,7 +300,6 @@ class SC_alt_palette {
        function main() {
 
                $this->content='';
-               $this->content.=$this->doc->startPage('TYPO3 Edit Palette');
 
                $inData = explode(':',$this->inData);
 
@@ -330,6 +329,11 @@ class SC_alt_palette {
                                // Add all the content, including JavaScript as needed.
                        $this->content.=$tceforms->printNeededJSFunctions_top().$formContent.$tceforms->printNeededJSFunctions();
                }
+
+               // Assemble the page:
+               $tempContent = $this->content;
+               $this->content = $this->doc->startPage('TYPO3 Edit Palette');
+               $this->content.= $tempContent;
        }
 
        /**