[TYPO3-dev] function to get extension's $conf array

Oliver Klee typo3-german-01 at oliverklee.de
Tue Jul 11 22:18:44 CEST 2006


Hi,

Christoph Koehler schrieb:
> Is there a function that can give me any extensions $conf array?

Ist ein bisschen aufwändiger ... in meiner Extension "oelib" mache ich
das so (funktioniert sowohl im BE als auch im FE und müsste mit jedem
Extension-Key funktionieren):

[snip]

if (TYPO3_MODE == 'BE') {
	// On the back end, we need to create our own template setup.
	$template = t3lib_div::makeInstance('t3lib_TStemplate');
	// do not log time-performance information
	$template->tt_track = 0;
	$template->init();

	// Get the root line
	$sys_page = t3lib_div::makeInstance('t3lib_pageSelect');
	// the selected page in the BE is found
	// exactly as in t3lib_SCbase::init()
	$rootline = $sys_page->getRootLine(intval(t3lib_div::_GP('id')));

	// This generates the constants/config + hierarchy info for the template.
	$template->runThroughTemplates($rootline, 0);
	$template->generateConfig();

	$this->conf = $template->setup['plugin.']['tx_'.$this->extKey.'.'];
} else {
	// On the front end, we can use the provided template setup.
	$this->conf =
$GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_'.$this->extKey.'.'];
}

[snip]

Gruß,


Oliver




More information about the TYPO3-dev mailing list