Index: typo3/template.php =================================================================== --- typo3/template.php (revision 8272) +++ typo3/template.php (working copy) @@ -254,6 +254,11 @@ // Initializes the page rendering object: $this->getPageRenderer(); + // Only set the backPath if it is currently empty. May already be set by subclass. + if (!$this->backPath) { + $this->backPath = $GLOBALS['BACK_PATH']; + } + // Setting default scriptID: if (($temp_M = (string) t3lib_div::_GET('M')) && $GLOBALS['TBE_MODULES']['_PATHS'][$temp_M]) { $this->scriptID = preg_replace('/^.*\/(sysext|ext)\//', 'ext/', $GLOBALS['TBE_MODULES']['_PATHS'][$temp_M] . 'index.php'); @@ -1107,13 +1112,13 @@ function addStyleSheetDirectory($path) { // calculation needed, when TYPO3 source is used via a symlink // absolute path to the stylesheets - $filePath = dirname(t3lib_div::getIndpEnv('SCRIPT_FILENAME')) . '/' . $GLOBALS['BACK_PATH'] . $path; + $filePath = dirname(t3lib_div::getIndpEnv('SCRIPT_FILENAME')) . '/' . $this->backPath . $path; // clean the path $resolvedPath = t3lib_div::resolveBackPath($filePath); // read all files in directory and sort them alphabetically $files = t3lib_div::getFilesInDir($resolvedPath, 'css', FALSE, 1); foreach ($files as $file) { - $this->pageRenderer->addCssFile($GLOBALS['BACK_PATH'] . $path . $file, 'stylesheet', 'all'); + $this->pageRenderer->addCssFile($this->backPath . $path . $file, 'stylesheet', 'all'); } } @@ -2263,6 +2268,17 @@ class frontendDoc extends template { /** + * Constructor for frontendDoc. Sets up backPath and calls parent constructor. + */ + public function __construct() { + $this->getPageRenderer(); + $this->backPath = $GLOBALS['TSFE']->backPath = TYPO3_mainDir; + $this->pageRenderer->setBackPath($this->backPath); + + parent::__construct(); + } + + /** * Gets instance of PageRenderer * * @return t3lib_PageRenderer @@ -2282,8 +2298,6 @@ */ public function insertHeaderData() { - $this->backPath = $GLOBALS['TSFE']->backPath = TYPO3_mainDir; - $this->pageRenderer->setBackPath($this->backPath); $this->docStyle(); // add applied JS/CSS to $GLOBALS['TSFE']