Bug #23272 » 15242_v2.diff

Administrator Admin, 2010-07-27 18:14

View differences:

typo3/template.php (working copy)
254 254
			// Initializes the page rendering object:
255 255
		$this->getPageRenderer();
256 256

  
257
			// Only set the backPath if it is currently empty. May already be set by subclass.
258
		if (!$this->backPath) {
259
			$this->backPath = $GLOBALS['BACK_PATH'];
260
		}
261

  
257 262
			// Setting default scriptID:
258 263
		if (($temp_M = (string) t3lib_div::_GET('M')) && $GLOBALS['TBE_MODULES']['_PATHS'][$temp_M]) {
259 264
			$this->scriptID = preg_replace('/^.*\/(sysext|ext)\//', 'ext/', $GLOBALS['TBE_MODULES']['_PATHS'][$temp_M] . 'index.php');
......
1107 1112
	function addStyleSheetDirectory($path) {
1108 1113
			// calculation needed, when TYPO3 source is used via a symlink
1109 1114
			// absolute path to the stylesheets
1110
		$filePath = dirname(t3lib_div::getIndpEnv('SCRIPT_FILENAME')) . '/' . $GLOBALS['BACK_PATH'] . $path;
1115
		$filePath = dirname(t3lib_div::getIndpEnv('SCRIPT_FILENAME')) . '/' . $this->backPath . $path;
1111 1116
			// clean the path
1112 1117
		$resolvedPath = t3lib_div::resolveBackPath($filePath);
1113 1118
			// read all files in directory and sort them alphabetically
1114 1119
		$files = t3lib_div::getFilesInDir($resolvedPath, 'css', FALSE, 1);
1115 1120
		foreach ($files as $file) {
1116
			$this->pageRenderer->addCssFile($GLOBALS['BACK_PATH'] . $path . $file, 'stylesheet', 'all');
1121
			$this->pageRenderer->addCssFile($this->backPath . $path . $file, 'stylesheet', 'all');
1117 1122
		}
1118 1123
	}
1119 1124

  
......
2263 2268
class frontendDoc extends template {
2264 2269

  
2265 2270
	/**
2271
	 * Constructor for frontendDoc. Sets up backPath and calls parent constructor.
2272
	 */
2273
	public function __construct() {
2274
		$this->getPageRenderer();
2275
		$this->backPath = $GLOBALS['TSFE']->backPath = TYPO3_mainDir;
2276
		$this->pageRenderer->setBackPath($this->backPath);
2277

  
2278
		parent::__construct();
2279
	}
2280

  
2281
	/**
2266 2282
	 * Gets instance of PageRenderer
2267 2283
	 *
2268 2284
	 * @return	t3lib_PageRenderer
......
2282 2298
	 */
2283 2299
	public function insertHeaderData() {
2284 2300

  
2285
		$this->backPath = $GLOBALS['TSFE']->backPath = TYPO3_mainDir;
2286
		$this->pageRenderer->setBackPath($this->backPath);
2287 2301
		$this->docStyle();
2288 2302

  
2289 2303
			// add applied JS/CSS to $GLOBALS['TSFE']
(2-2/2)