CC-5555 : Implement simple caching for preferences
making sure locale/timezone is returned properly in generic calls.
This commit is contained in:
parent
06323a40fd
commit
f69dd123ca
1 changed files with 6 additions and 4 deletions
|
@ -559,12 +559,13 @@ class Application_Model_Preference
|
|||
self::setValue("user_timezone", $timezone, true);
|
||||
}
|
||||
|
||||
public static function GetUserTimezone($id)
|
||||
public static function GetUserTimezone()
|
||||
{
|
||||
$timezone = self::getValue("user_timezone", true);
|
||||
if (!$timezone) {
|
||||
return self::GetDefaultTimezone();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return $timezone;
|
||||
}
|
||||
}
|
||||
|
@ -598,7 +599,8 @@ class Application_Model_Preference
|
|||
$locale = self::getValue("user_locale", true);
|
||||
if (!$locale) {
|
||||
return self::GetDefaultLocale();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
return $locale;
|
||||
}
|
||||
}
|
||||
|
@ -618,7 +620,7 @@ class Application_Model_Preference
|
|||
$userId = self::getUserId();
|
||||
|
||||
if (!is_null($userId)) {
|
||||
return self::GetUserLocale($userId);
|
||||
return self::GetUserLocale();
|
||||
}
|
||||
else {
|
||||
return self::GetDefaultLocale();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue