[TYPO3-dev] get lg_typo3 with sys_language_uid
Tapio Markula
tapio.markula at xetpoint.fi
Mon Nov 24 14:48:58 CET 2008
Steffen Kamper
> get the TS:
> function loadTS($pageUid) {
> $sysPageObj = t3lib_div::makeInstance('t3lib_pageSelect');
> $rootLine = $sysPageObj->getRootLine($pageUid);
> $TSObj = t3lib_div::makeInstance('t3lib_tsparser_ext');
> $TSObj->tt_track = 0;
> $TSObj->init();
> $TSObj->runThroughTemplates($rootLine);
> $TSObj->generateConfig();
> return $TSObj->setup;
> }
>
this dosn't fit for getting language because config.language might need
sevaral values - each for every sys_language_uid
at this respect
$res =
$GLOBALS['TYPO3_DB']->exec_SELECTquery('static_lang_isocode','sys_language',
'uid = ' . $this->sys_language_uid);
if ( $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res) ) {
$res2 =
$GLOBALS['TYPO3_DB']->exec_SELECTquery('lg_typo3','static_languages',
'uid = ' . $row['static_lang_isocode']);
if ( $row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res2) )
$lang=$row2['lg_typo3'];
}
if(!$lang) $lang='default';
$LANG->init($lang);
works better. But getting the TS config might be otherwise usable.
More information about the TYPO3-dev
mailing list