Fixed bug #8518: Wrong JavaScript inclusion in t3lib_TCEforms
authorOliver Hader <oliver.hader@typo3.org>
Sun, 28 Sep 2008 19:53:51 +0000 (19:53 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Sun, 28 Sep 2008 19:53:51 +0000 (19:53 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@4257 709f56b5-9817-0410-a4d7-c38de5d9e867

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

index ac18209..80a9100 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-09-28  Oliver Hader  <oliver@typo3.org>
+
+       * Fixed bug #8518: Wrong JavaScript inclusion in t3lib_TCEforms
+
 2008-09-27  Dmitry Dulepov  <dmitry@typo3.org>
 
        * Fixed bug #9412: config.absRefPrefix can force wrong URL when linking across domains
index 49a190c..03066a2 100755 (executable)
@@ -5046,7 +5046,6 @@ 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:
@@ -5076,18 +5075,17 @@ class t3lib_TCEforms    {
 
                if (!$update) {
                        if ($this->loadMD5_JS) {
-                               $jsFile[] =     '<script type="text/javascript" src="'.$this->backPath.'md5.js"></script>';
+                               $GLOBALS['TBE_TEMPLATE']->loadJavascriptLib('md5.js');
                        }
 
-                       $jsFile[] = '<script type="text/javascript" src="'.$this->backPath.'contrib/prototype/prototype.js"></script>';
-                       $jsFile[] = '<script type="text/javascript" src="'.$this->backPath.'contrib/scriptaculous/scriptaculous.js"></script>';
-                       $jsFile[] =     '<script type="text/javascript" src="'.$this->backPath.'../t3lib/jsfunc.evalfield.js"></script>';
-                       $jsFile[] =     '<script type="text/javascript" src="'.$this->backPath.'jsfunc.tbe_editor.js"></script>';
+                       $GLOBALS['TBE_TEMPLATE']->loadJavascriptLib('contrib/prototype/prototype.js');
+                       $GLOBALS['TBE_TEMPLATE']->loadJavascriptLib('../t3lib/jsfunc.evalfield.js');
+                       $GLOBALS['TBE_TEMPLATE']->loadJavascriptLib('jsfunc.tbe_editor.js');
 
                                // if IRRE fields were processed, add the JavaScript functions:
                        if ($this->inline->inlineCount) {
-                               $jsFile[] = '<script src="'.$this->backPath.'contrib/scriptaculous/scriptaculous.js" type="text/javascript"></script>';
-                               $jsFile[] = '<script src="'.$this->backPath.'../t3lib/jsfunc.inline.js" type="text/javascript"></script>';
+                               $GLOBALS['TBE_TEMPLATE']->loadJavascriptLib('contrib/scriptaculous/scriptaculous.js');
+                               $GLOBALS['TBE_TEMPLATE']->loadJavascriptLib('../t3lib/jsfunc.inline.js');
                                $out .= '
                                inline.setPrependFormFieldNames("'.$this->inline->prependNaming.'");
                                inline.setNoTitleString("'.addslashes(t3lib_BEfunc::getNoRecordTitle(true)).'");
@@ -5220,8 +5218,7 @@ class t3lib_TCEforms      {
 
                        // Regular direct output:
                if (!$update) {
-                       $spacer = chr(10).chr(9);
-                       $out  = $spacer.implode($spacer, $jsFile).t3lib_div::wrapJS($out);
+                       $out  = chr(10) . chr(9) . t3lib_div::wrapJS($out);
                }
 
                return $out;
index 9e781b6..aa6e8bb 100755 (executable)
@@ -448,7 +448,7 @@ class SC_alt_doc {
                $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']);
 
                        // Create an instance of the document template object
-               $this->doc = t3lib_div::makeInstance('template');
+               $this->doc = $GLOBALS['TBE_TEMPLATE'];
                $this->doc->backPath = $BACK_PATH;
                $this->doc->setModuleTemplate('templates/alt_doc.html');
                $this->doc->form = '<form action="'.htmlspecialchars($this->R_URI).'" method="post" enctype="'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'].'" name="editform" onsubmit="document.editform._scrollPosition.value=(document.documentElement.scrollTop || document.body.scrollTop); return TBE_EDITOR.checkSubmit(1);">';