Sunday 03 August 2003 2:15:15 pm
To clarify: I wanted to dynamically set the current ContentObjectLocale (not just read it from the site.ini-file).
I was able to work around this by modifying the two files:
/kernel/classes/ezcontentobjecttreenode.php /kernel/classes/ezcontentobject.php The following code reads out the session variable that has been previously set through another module, and defaults to the value from the ini file if the session variable is empty:
$lang = false;
$xpohttp =& eZHTTPTool::instance();
//$xpohttp->setSessionVariable( "xpoLocale" ,"nor-NO");
if ( $xpohttp->hasSessionVariable( "xpoLocale" ) ) {
$lang = $xpohttp->sessionVariable( "xpoLocale" );
}
if ($lang === false) {
$ini =& eZINI::instance();
$lang = $ini->variable( 'RegionalSettings', 'ContentObjectLocale' );
} It's odd that this functionality is not built into EZ Publish by default, as few modifications were needed to make this work. It took some effort to figure out how to accomplish it though. Feel free to contact me if you want more info. sven[at]maxus.no
|