Added getUserLocale function to pull locale data into the Login form
This commit is contained in:
parent
eecd3fa188
commit
e5e7942b42
1 changed files with 17 additions and 0 deletions
|
@ -47,5 +47,22 @@ class Application_Model_Locale
|
||||||
textdomain($domain);
|
textdomain($domain);
|
||||||
bind_textdomain_codeset($domain, $codeset);
|
bind_textdomain_codeset($domain, $codeset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* We need this function for the case where a user has logged out, but
|
||||||
|
* has an airtime_locale cookie containing their locale setting.
|
||||||
|
*
|
||||||
|
* If the user does not have an airtime_locale cookie set, we default
|
||||||
|
* to the station locale.
|
||||||
|
*
|
||||||
|
* When the user logs in, the value set in the login form will be passed
|
||||||
|
* into the airtime_locale cookie. This cookie is also updated when
|
||||||
|
* a user updates their user settings.
|
||||||
|
*/
|
||||||
|
public static function getUserLocale() {
|
||||||
|
$request = Zend_Controller_Front::getInstance()->getRequest();
|
||||||
|
$locale = $request->getCookie('airtime_locale', Application_Model_Preference::GetLocale());
|
||||||
|
return $locale;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue