[TYPO3-templavoila] Adding a hook to TV

Xavier Perseguers typo3 at perseguers.ch
Wed Oct 1 17:44:43 CEST 2008


Hello Dmitry,

As I read you are about to review Niels' code, could you add a hook to 
tx_templavoila_module1 in function getAvailableLanguages(), at the end, 
in order to let others change the list of languages (= disable some of 
them)?

Currently I'm using XCLASS to do this:

function getAvailableLanguages($id=0, $onlyIsoCoded=true, 
$setDefault=true, $setMulti=false)    {
	$languages = parent::getAvailableLanguages($id, $onlyIsoCoded, 
$setDefault, $setMulti);

	$disableLanguages = t3lib_div::trimExplode(',', 
$this->modSharedTSconfig['properties']['disableLanguages'], 1);

	foreach ($disableLanguages as $pid) {
		unset($languages[$pid]);
	}

	return $languages;
}

and I would prefer using a hook than XCLASSing TV.

-- 
Xavier Perseguers
http://xavier.perseguers.ch/en/tutorials/typo3.html


More information about the TYPO3-project-templavoila mailing list