Fixed bug #13262: replace hardcoded typo3/ with TYPO3_mainDir (Thanks to Georg Ringer)
authorBenni Mack <benni.mack@typo3.org>
Fri, 26 Feb 2010 14:41:11 +0000 (14:41 +0000)
committerBenni Mack <benni.mack@typo3.org>
Fri, 26 Feb 2010 14:41:11 +0000 (14:41 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7051 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/init.php
typo3/sysext/cms/tslib/class.tslib_content.php
typo3/sysext/cms/tslib/class.tslib_pagegen.php

index e425008..d7d9d29 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2010-02-26  Benjamin Mack  <benni@typo3.org>
 
+       * Fixed bug #13262: replace hardcoded typo3/ with TYPO3_mainDir (Thanks to Georg Ringer)
        * Fixed bug #11507: tt_content's TCA spaceBefore and spaceAfter got a hardcoded limit of 50 (Thanks to Georg Ringer)
        * Fixed bug #13591: Full search causes error if TCA has tables without any columns (Thanks to Fabrizio Branca)
        * Fixed bug #13493: Cleanup return value in t3lib_userauthgroup check() (Thanks to Georg Ringer)
index 7db771b..3c11206 100644 (file)
@@ -88,6 +88,16 @@ define('TYPO3_mainDir', 'typo3/');           // This is the directory of the backend admi
 
 
 // *******************************
+// Fix BACK_PATH, if the TYPO3_mainDir is set to something else than 
+// typo3/, this is a workaround because the conf.php of the old modules
+// still have "typo3/" hardcoded. Can be removed once we don't have to worry about
+// legacy modules (with conf.php and $BACK_PATH) anymore. See RFC / Bug #13262 for more details.
+// *******************************
+if (isset($BACK_PATH) && strlen($BACK_PATH) > 0 && TYPO3_mainDir != 'typo3/' && substr($BACK_PATH, -7) == '/typo3/') {
+       $BACK_PATH = substr($BACK_PATH, 0, -6) . TYPO3_mainDir;
+}
+
+// *******************************
 // Checking path
 // *******************************
 $temp_path = str_replace('\\','/',dirname(PATH_thisScript).'/');
index 3be6582..61f18af 100644 (file)
@@ -2822,10 +2822,10 @@ class tslib_cObj {
                $typeConf = $conf[$conf['type'] . '.'];
 
                        //add SWFobject js-file
-               $GLOBALS['TSFE']->getPageRenderer()->addJsFile('typo3/contrib/flashmedia/swfobject/swfobject.js');
+               $GLOBALS['TSFE']->getPageRenderer()->addJsFile(TYPO3_mainDir . 'contrib/flashmedia/swfobject/swfobject.js');
 
                $player = $this->stdWrap($conf[$conf['type'] . '.']['player'], $conf[$conf['type'] . '.']['player.']);
-               $installUrl = $conf['installUrl'] ? $conf['installUrl'] : $prefix . 'typo3/contrib/flashmedia/swfobject/expressInstall.swf';
+               $installUrl = $conf['installUrl'] ? $conf['installUrl'] : $prefix . TYPO3_mainDir . 'contrib/flashmedia/swfobject/expressInstall.swf';
                $filename = $this->stdWrap($conf['file'], $conf['file.']);
                if ($filename && $conf['forcePlayer']) {
                        if (strpos($filename, '://') !== FALSE) {
@@ -2931,7 +2931,7 @@ class tslib_cObj {
                $typeConf = $conf[$conf['type'] . '.'];
 
                        //add QTobject js-file
-               $GLOBALS['TSFE']->getPageRenderer()->addJsFile('typo3/contrib/flashmedia/qtobject/qtobject.js');
+               $GLOBALS['TSFE']->getPageRenderer()->addJsFile(TYPO3_mainDir . 'contrib/flashmedia/qtobject/qtobject.js');
                $replaceElementIdString = uniqid('mmqt');
                $GLOBALS['TSFE']->register['MMQTID'] = $replaceElementIdString;
                $qtObject = 'QTObject' . $replaceElementIdString;
index a41ec13..006aa7d 100644 (file)
@@ -342,7 +342,7 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
                /** @var $pageRenderer t3lib_PageRenderer */
                $pageRenderer = $GLOBALS['TSFE']->getPageRenderer();
 
-               $pageRenderer->backPath = 'typo3/';
+               $pageRenderer->backPath = TYPO3_mainDir;
 
                if ($GLOBALS['TSFE']->config['config']['moveJsFromHeaderToFooter']) {
                        $pageRenderer->enableMoveJsFromHeaderToFooter();