Index: typo3/sysext/cms/tslib/class.tslib_pagegen.php =================================================================== --- typo3/sysext/cms/tslib/class.tslib_pagegen.php (revision 6863) +++ typo3/sysext/cms/tslib/class.tslib_pagegen.php (working copy) @@ -549,8 +549,9 @@ $GLOBALS['TSFE']->pSetup['includeCSS.'][$key . '.']['title'] ? $GLOBALS['TSFE']->pSetup['includeCSS.'][$key . '.']['title'] : '', $GLOBALS['TSFE']->pSetup['includeCSS.'][$key . '.']['compress'] ? TRUE : FALSE, $GLOBALS['TSFE']->pSetup['includeCSS.'][$key . '.']['forceOnTop'] ? TRUE : FALSE, - $GLOBALS['TSFE']->pSetup['includeCSS.'][$key . '.']['allWrap']); - + $GLOBALS['TSFE']->pSetup['includeCSS.'][$key . '.']['allWrap'], + $GLOBALS['TSFE']->pSetup['includeCSS.'][$key . '.']['stdWrap.'] + ); } } } @@ -684,7 +685,8 @@ htmlspecialchars($type), $GLOBALS['TSFE']->pSetup['includeJSlibs.'][$key . '.']['compress'] ? TRUE : FALSE, $GLOBALS['TSFE']->pSetup['includeJSlibs.'][$key . '.']['forceOnTop'] ? TRUE : FALSE, - $GLOBALS['TSFE']->pSetup['includeJSlibs.'][$key . '.']['allWrap'] + $GLOBALS['TSFE']->pSetup['includeJSlibs.'][$key . '.']['allWrap'], + $GLOBALS['TSFE']->pSetup['includeJSlibs.'][$key . '.']['stdWrap.'] ); } } @@ -706,7 +708,8 @@ htmlspecialchars($type), $GLOBALS['TSFE']->pSetup['includeJSFooterlibs.'][$key . '.']['compress'] ? TRUE : FALSE, $GLOBALS['TSFE']->pSetup['includeJSFooterlibs.'][$key . '.']['forceOnTop'] ? TRUE : FALSE, - $GLOBALS['TSFE']->pSetup['includeJSFooterlibs.'][$key . '.']['allWrap'] + $GLOBALS['TSFE']->pSetup['includeJSFooterlibs.'][$key . '.']['allWrap'], + $GLOBALS['TSFE']->pSetup['includeJSFooterlibs.'][$key . '.']['stdWrap.'] ); } } @@ -728,7 +731,8 @@ htmlspecialchars($type), $GLOBALS['TSFE']->pSetup['includeJS.'][$key . '.']['compress'] ? TRUE : FALSE, $GLOBALS['TSFE']->pSetup['includeJS.'][$key . '.']['forceOnTop'] ? TRUE : FALSE, - $GLOBALS['TSFE']->pSetup['includeJS.'][$key . '.']['allWrap'] + $GLOBALS['TSFE']->pSetup['includeJS.'][$key . '.']['allWrap'], + $GLOBALS['TSFE']->pSetup['includeJS.'][$key . '.']['stdWrap.'] ); } } @@ -749,7 +753,8 @@ htmlspecialchars($type), $GLOBALS['TSFE']->pSetup['includeJSFooter.'][$key . '.']['compress'] ? TRUE : FALSE, $GLOBALS['TSFE']->pSetup['includeJSFooter.'][$key . '.']['forceOnTop'] ? TRUE : FALSE, - $GLOBALS['TSFE']->pSetup['includeJSFooter.'][$key . '.']['allWrap'] + $GLOBALS['TSFE']->pSetup['includeJSFooter.'][$key . '.']['allWrap'], + $GLOBALS['TSFE']->pSetup['includeJSFooter.'][$key . '.']['stdWrap.'] ); } } Index: t3lib/class.t3lib_pagerenderer.php =================================================================== --- t3lib/class.t3lib_pagerenderer.php (revision 6863) +++ t3lib/class.t3lib_pagerenderer.php (working copy) @@ -36,6 +36,8 @@ */ class t3lib_PageRenderer implements t3lib_Singleton { + protected $cObj; + protected $compressJavascript = FALSE; protected $compressCss = FALSE; protected $removeLineBreaksFromTemplate = FALSE; @@ -145,6 +147,18 @@ ); } + + /** + * helper function to get an instance of the tslib_cObj class + * + * @return tslib_cObj + */ + public function getCObj() { + if (!isset($this->cObj)) { + $this->cObj = t3lib_div::makeInstance('tslib_cObj'); + } + return $this->cObj; + } /** * reset all vars to initial values @@ -558,9 +572,10 @@ * @param boolean $compress flag if library should be compressed * @param boolean $forceOnTop flag if added library should be inserted at begin of this block * @param string $allWrap + * @param array $stdWrap stdWrap options * @return void */ - public function addJsLibrary($name, $file, $type = 'text/javascript', $compress = FALSE, $forceOnTop = FALSE, $allWrap = '') { + public function addJsLibrary($name, $file, $type = 'text/javascript', $compress = FALSE, $forceOnTop = FALSE, $allWrap = '', $stdWrap = array()) { if (!in_array(strtolower($name), $this->jsLibs)) { $this->jsLibs[strtolower($name)] = array ( 'file' => $file, @@ -568,7 +583,8 @@ 'section' => self::PART_HEADER, 'compress' => $compress, 'forceOnTop' => $forceOnTop, - 'allWrap' => $allWrap + 'allWrap' => $allWrap, + 'stdWrap' => $stdWrap ); } @@ -583,9 +599,10 @@ * @param boolean $compress flag if library should be compressed * @param boolean $forceOnTop flag if added library should be inserted at begin of this block * @param string $allWrap + * @param array $stdWrap stdWrap options * @return void */ - public function addJsFooterLibrary($name, $file, $type = 'text/javascript', $compress = FALSE, $forceOnTop = FALSE, $allWrap = '') { + public function addJsFooterLibrary($name, $file, $type = 'text/javascript', $compress = FALSE, $forceOnTop = FALSE, $allWrap = '', $stdWrap = array()) { if (!in_array(strtolower($name), $this->jsLibs)) { $this->jsLibs[strtolower($name)] = array ( 'file' => $file, @@ -593,7 +610,8 @@ 'section' => self::PART_FOOTER, 'compress' => $compress, 'forceOnTop' => $forceOnTop, - 'allWrap' => $allWrap + 'allWrap' => $allWrap, + 'stdWrap' => $stdWrap ); } @@ -607,16 +625,18 @@ * @param boolean $compress * @param boolean $forceOnTop * @param string $allWrap + * @param array $stdWrap stdWrap options * @return void */ - public function addJsFile($file, $type = 'text/javascript', $compress = TRUE, $forceOnTop = FALSE, $allWrap = '') { + public function addJsFile($file, $type = 'text/javascript', $compress = TRUE, $forceOnTop = FALSE, $allWrap = '', $stdWrap = array()) { if (!isset($this->jsFiles[$file])) { $this->jsFiles[$file] = array ( 'type' => $type, 'section' => self::PART_HEADER, 'compress' => $compress, 'forceOnTop' => $forceOnTop, - 'allWrap' => $allWrap + 'allWrap' => $allWrap, + 'stdWrap' => $stdWrap ); } } @@ -628,16 +648,18 @@ * @param string $type * @param boolean $compress * @param boolean $forceOnTop + * @param array $stdWrap stdWrap options * @return void */ - public function addJsFooterFile($file, $type = 'text/javascript', $compress = TRUE, $forceOnTop = FALSE, $allWrap = '') { + public function addJsFooterFile($file, $type = 'text/javascript', $compress = TRUE, $forceOnTop = FALSE, $allWrap = '', $stdWrap = array()) { if (!isset($this->jsFiles[$file])) { $this->jsFiles[$file] = array ( 'type' => $type, 'section' => self::PART_FOOTER, 'compress' => $compress, 'forceOnTop' => $forceOnTop, - 'allWrap' => $allWrap + 'allWrap' => $allWrap, + 'stdWrap' => $stdWrap ); } } @@ -712,9 +734,11 @@ * @param string $title * @param boolean $compress * @param boolean $forceOnTop + * @param string $allWrap + * @param array $stdWrap stdWrap options * @return void */ - public function addCssFile($file, $rel = 'stylesheet', $media = 'screen', $title = '', $compress = TRUE, $forceOnTop = FALSE, $allWrap = '') { + public function addCssFile($file, $rel = 'stylesheet', $media = 'screen', $title = '', $compress = TRUE, $forceOnTop = FALSE, $allWrap = '', $stdWrap = array()) { if (!isset($this->cssFiles[$file])) { $this->cssFiles[$file] = array ( 'rel' => $rel, @@ -722,7 +746,8 @@ 'title' => $title, 'compress' => $compress, 'forceOnTop' => $forceOnTop, - 'allWrap' => $allWrap + 'allWrap' => $allWrap, + 'stdWrap' => $stdWrap ); } } @@ -1004,6 +1029,9 @@ if ($properties['allWrap'] && strpos($properties['allWrap'], '|') !== FALSE) { $tag = str_replace('|', $tag, $properties['allWrap']); } + if ($properties['stdWrap']) { + $tag = $this->getCObj()->stdWrap($tag, $properties['stdWrap']); + } if ($properties['forceOnTop']) { $cssFiles = $tag . chr(10) . $cssFiles; } else { @@ -1032,6 +1060,9 @@ if ($properties['allWrap'] && strpos($properties['allWrap'], '|') !== FALSE) { $tag = str_replace('|', $tag, $properties['allWrap']); } + if ($properties['stdWrap']) { + $tag = $this->getCObj()->stdWrap($tag, $properties['stdWrap']); + } if ($properties['forceOnTop']) { if ($properties['section'] === self::PART_HEADER) { $jsLibs = $tag . chr(10) . $jsLibs; @@ -1056,6 +1087,9 @@ if ($properties['allWrap'] && strpos($properties['allWrap'], '|') !== FALSE) { $tag = str_replace('|', $tag, $properties['allWrap']); } + if ($properties['stdWrap']) { + $tag = $this->getCObj()->stdWrap($tag, $properties['stdWrap']); + } if ($properties['forceOnTop']) { if ($properties['section'] === self::PART_HEADER) { $jsFiles = $tag . chr(10) . $jsFiles;