[TYPO3-core] RFC: #11397: [Feature] Add class for render HTML header/footer for BE and FE

Steffen Gebert steffen at steffen-gebert.de
Sun Aug 30 00:54:19 CEST 2009


Hi Steffen,

after several hours of reviewing:

* please remove the two lines
	#$this->csConvObj = TYPO3_MODE == 'BE' ? $GLOBAL['LANG']->csConvObj :  
$GLOBALS['TSFE']->csConvObj;
	#$this->lang = TYPO3_MODE == 'BE' ? $GLOBALS['BE_USER']->uc['lang'] :  
$GLOBALS['TSFE']->lang;

* CGL: "," after the last entry of arrays.

* I would prefer config.concatenateJsAndCss over  
config.concatenateJSandCSS (JSand -> JsAnd)


Now the more important ones ;-)

* What's the sense of ###POSTJSMARKER###? It's only replaced in BE. In FE  
output is <!-- ###POSTJSMARKER### -> (as written in the template). Don't  
like this unneccessarey output.

* pagerender: 1230
if ($this->compressJavascript &&  
$GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['cssCompressHandler']) {
hast to be $this->compressCss

* I think removeEmptyLinesFromTemplate is never set to TRUE. Furthermore  
it wouldn't remove empty lines, but all line breaks, doesn't it?

* If config.concatenateJSandCSS = 1, there's an access to protected  
variable concatenateFiles. So please add a setter and call it in  
pagegen:958 instead of setting the variable directly.

* I tried to implement a simple CSS compressor:
function user_concatter($params, $ref) {
	$code = '';
	foreach ($params['cssFiles'] as $file => $settings) {
		$code .= file_get_contents(PATH_site . $file);
		unset($params['cssFiles'][$file]);
	}
	$concatted = 'typo3temp/concatted.css';
	t3lib_div::writeFileToTypo3tempDir(PATH_site . $concatted, $code);
	$ref->addCssFile($concatted);
}

Of course, this doesn't work as $params is later neglected. So what worked  
was changing pagerender to
$params = array(
	'jsFiles'	=> &this->jsFiles,
	'jsFooterFiles'	=> &this->jsFooterFiles,
	'cssFiles'	=> &this->cssFiles,
);
(so passing by reference).
Otherwise I had no idea, how to remove the unnecessary CSS files (as  
there's no removeCssFile()).

Nevertheless a really nice improvement, which I really hope to get into 4.3

Steffen


More information about the TYPO3-team-core mailing list