Index: t3lib/class.t3lib_pagerenderer.php =================================================================== --- t3lib/class.t3lib_pagerenderer.php (revision 8251) +++ t3lib/class.t3lib_pagerenderer.php (working copy) @@ -94,6 +94,13 @@ const PART_HEADER = 1; const PART_FOOTER = 2; + // paths to contibuted libraries + protected $prototypePath = 'contrib/prototype/'; + protected $scriptaculousPath = 'contrib/scriptaculous/'; + protected $extCorePath = 'contrib/extjs/'; + protected $extJsPath = 'contrib/extjs/'; + + // internal flags for JS-libraries protected $addPrototype = FALSE; protected $addScriptaculous = FALSE; @@ -309,6 +316,46 @@ $this->bodyContent = $content; } + /** + * Sets Path for prototype library (relative to typo3 directory) + * + * @param string path + * @return void + */ + public function setPrototypePath($path) { + $this->prototypePath = $path; + } + + /** + * Sets Path for scriptaculous library (relative to typo3 directory) + * + * @param string $path + * @return void + */ + public function setScriptaculousPath($path) { + $this->scriptaculousPath = $path; + } + + /** + * Sets Path for Ext Core library (relative to typo3 directory) + * + * @param string $path + * @return void + */ + public function setExtCorePath($path) { + $this->extCorePath = $path; + } + + /** + * Sets Path for ExtJs library (relative to typo3 directory) + * + * @param string $path + * @return void + */ + public function setExtJsPath($path) { + $this->extJsPath = $path; + } + /*****************************************************/ /* */ /* Public Enablers / Disablers */ @@ -581,6 +628,42 @@ return $this->bodyContent; } + /** + * Gets Path for prototype library (relative to typo3 directory) + * + * @return string + */ + public function getPrototypePath() { + return $this->prototypePath; + } + + /** + * Gets Path for scriptaculous library (relative to typo3 directory) + * + * @return string + */ + public function getScriptaculousPath() { + return $this->scriptaculousPath; + } + + /** + * Gets Path for Ext Core library (relative to typo3 directory) + * + * @return string + */ + public function getExtCorePath() { + return $this->extCorePath; + } + + /** + * Gets Path for ExtJs library (relative to typo3 directory) + * + * @return string + */ + public function getExtJsPath() { + return $this->extJsPath; + } + /*****************************************************/ /* */ /* Public Function to add Data */ @@ -1262,9 +1345,9 @@ $out = ''; if ($this->addPrototype) { - $out .= '' . LF; - unset($this->jsFiles[$this->backPath . 'contrib/prototype/prototype.js']); + unset($this->jsFiles[$this->backPath . $this->prototypePath .'prototype.js']); } if ($this->addScriptaculous) { @@ -1282,32 +1365,32 @@ if (count($mods)) { foreach ($mods as $module) { $out .= '' . LF; - unset($this->jsFiles[$this->backPath . 'contrib/scriptaculous/' . $module . '.js']); + $this->scriptaculousPath . $module . '.js') . '" type="text/javascript">' . LF; + unset($this->jsFiles[$this->backPath . $this->scriptaculousPath . $module . '.js']); } } - $out .= '' . LF; - unset($this->jsFiles[$this->backPath . 'contrib/scriptaculous/scriptaculous.js']); + $out .= '' . LF; + unset($this->jsFiles[$this->backPath . $this->scriptaculousPath . 'scriptaculous.js']); } // include extCore if ($this->addExtCore) { $out .= '' . LF; - unset($this->jsFiles[$this->backPath . 'contrib/extjs/ext-core' . ($this->enableExtCoreDebug ? '-debug' : '') . '.js']); + unset($this->jsFiles[$this->backPath . $this->extCorePath . 'ext-core' . ($this->enableExtCoreDebug ? '-debug' : '') . '.js']); } // include extJS if ($this->addExtJS) { // use the base adapter all the time - $out .= '' . LF; - $out .= '' . LF; // add extJS localization @@ -1321,7 +1404,7 @@ $extJsLang = isset($localeMap[$this->lang]) ? $localeMap[$this->lang] : $this->lang; // TODO autoconvert file from UTF8 to current BE charset if necessary!!!! - $extJsLocaleFile = 'contrib/extjs/locale/ext-lang-' . $extJsLang . '.js'; + $extJsLocaleFile = $this->extJsPath . 'locale/ext-lang-' . $extJsLang . '.js'; if (file_exists(PATH_typo3 . $extJsLocaleFile)) { $out .= '' . LF; @@ -1330,7 +1413,8 @@ // remove extjs from JScodeLibArray unset( - $this->jsFiles[$this->backPath . 'contrib/extjs/ext-all.js'], $this->jsFiles[$this->backPath . 'contrib/extjs/ext-all-debug.js'] + $this->jsFiles[$this->backPath . $this->extJsPath . 'ext-all.js'], + $this->jsFiles[$this->backPath . $this->extJsPath . 'ext-all-debug.js'] ); } @@ -1369,14 +1453,14 @@ if (isset($GLOBALS['TBE_STYLES']['extJS']['theme'])) { $this->addCssFile($this->backPath . $GLOBALS['TBE_STYLES']['extJS']['theme'], 'stylesheet', 'all', '', TRUE, TRUE); } else { - $this->addCssFile($this->backPath . 'contrib/extjs/resources/css/xtheme-blue.css', 'stylesheet', 'all', '', TRUE, TRUE); + $this->addCssFile($this->backPath . $this->extJsPath . 'resources/css/xtheme-blue.css', 'stylesheet', 'all', '', TRUE, TRUE); } } if ($this->extJScss) { if (isset($GLOBALS['TBE_STYLES']['extJS']['all'])) { $this->addCssFile($this->backPath . $GLOBALS['TBE_STYLES']['extJS']['all'], 'stylesheet', 'all', '', TRUE, TRUE); } else { - $this->addCssFile($this->backPath . 'contrib/extjs/resources/css/ext-all-notheme.css', 'stylesheet', 'all', '', TRUE, TRUE); + $this->addCssFile($this->backPath . $this->extJsPath . 'resources/css/ext-all-notheme.css', 'stylesheet', 'all', '', TRUE, TRUE); } } } else {