[Typo3-dev] Proposing hook

Jan Roehrich jan.roehrich at iao.fhg.de
Fri Oct 15 14:32:29 CEST 2004


I would suggest a hook in tslib_cObj->HMENU for wrapping around the whole
menu creation:

At the beginning of the function:
// Hook for wrapping around menus
$_hookObjects = Array();
if(is_array($GLOBALS["TYPO3_CONF_VARS"]['SC_OPTIONS']
['tslib/class.tslib_content.php']['HMENU_wrap'])) {
	foreach($GLOBALS["TYPO3_CONF_VARS"]['SC_OPTIONS']
['tslib/class.tslib_content.php']['HMENU_wrap'] as $_classRef) {
		$_procObj = &t3lib_div::getUserObj($_classRef);
		$_procObj->HMENU_begin($conf, $this);
		$_hookObjects[$_classRef] = $_procObj;
	}
}

At the End of the function (right before return):
// Hook for wrapping around menus
if(count($_hookObjects) > 0) {
	foreach($_hookObjects as $_procObj) {
		$content = $_procObj->HMENU_end($content, $conf, $this);
	}
}

For example this could be used to change the page's language temporarily
so we do not need this ugly user defined scripts for creating language
menus. I'm right working on an extension covering this.

And what about my proposal 2004/09/15?

Greetings Jan




More information about the TYPO3-dev mailing list