[TYPO3-dev] default language name for FE-Plugin
Franz Holzinger
franz at ttproducts.de
Fri Jun 14 10:49:49 CEST 2013
Hello Bernd,
Le 14. 06. 13 10:40, bernd wilke a écrit :
> As you can set the name of the default language in page-TSconfig with:
> mod.SHARED {
> defaultLanguageLabel = Deutsch
> defaultLanguageFlag = de.gif
> }
> I want to access this value from a FE-Plugin.
>
> I don't know if there is a dedicated variable, so I tried to access the
> page-TSconfig array:
>
> but trying it in 4.5.27 with "tslib_fe::getPagesTSconfig()" resulted in:
>
> Fatal error: Call to a member function getHash() on a non-object in
> /var/www/typo3_src-4.5.27/typo3/sysext/cms/tslib/class.tslib_fe.php on
> line 4560
>
> did I miss an initilaization which is not done automatically?
Use the $GLOBALS['TSFE'] object and not the class name, because you can see:
-----------
class tslib_fe {
...
function getPagesTSconfig() {
....
}
}
-----------
this is no static class.
solution:
$GLOBALS['TSFE']->getPagesTSconfig();
- Franz
More information about the TYPO3-dev
mailing list