本文整理汇总了PHP中BizSystem::getUserPreference方法的典型用法代码示例。如果您正苦于以下问题:PHP BizSystem::getUserPreference方法的具体用法?PHP BizSystem::getUserPreference怎么用?PHP BizSystem::getUserPreference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BizSystem
的用法示例。
在下文中一共展示了BizSystem::getUserPreference方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCurrentTheme
public static function getCurrentTheme()
{
if (Resource::$_currentTheme != null) {
return Resource::$_currentTheme;
}
$currentTheme = "";
if (isset($_GET['theme'])) {
$currentTheme = $_GET['theme'];
}
if ($currentTheme == "") {
$currentTheme = BizSystem::sessionContext()->getVar("THEME");
}
if ($currentTheme == "") {
$currentTheme = BizSystem::getUserPreference("theme");
}
if ($currentTheme == "" && defined('THEME_NAME')) {
$currentTheme = THEME_NAME;
}
if ($currentTheme == "") {
$currentTheme = Resource::DEFAULT_THEME;
}
// TODO: user pereference has language setting
BizSystem::sessionContext()->setVar("THEME", $currentTheme);
Resource::$_currentTheme = $currentTheme;
return $currentTheme;
}
示例2: getDefaultPerm
public static function getDefaultPerm($group)
{
$group = strtolower($group);
switch ($group) {
default:
case 'owner':
$setting = BizSystem::getUserPreference('owner_perm');
if ($setting != '') {
$perm_code = $setting;
} else {
$perm_code = DEFAULT_OWNER_PERM;
}
break;
case 'group':
$setting = BizSystem::getUserPreference('owner_group');
if ($setting != '') {
$perm_code = $setting;
} else {
$perm_code = DEFAULT_GROUP_PERM;
}
break;
case 'other':
$setting = BizSystem::getUserPreference('owner_other');
if ($setting != '') {
$perm_code = $setting;
} else {
$perm_code = DEFAULT_OTHER_PERM;
}
break;
}
return $perm_code;
}
示例3: getCurrentLangCode
public static function getCurrentLangCode()
{
if (I18n::$_langCode != null) {
return I18n::$_langCode;
}
$currentLanguage = BizSystem::sessionContext()->getVar("LANG");
// default language
if ($currentLanguage == "") {
$currentLanguage = BizSystem::getUserPreference("language");
}
if ($currentLanguage == "") {
$currentLanguage = I18n::DEFAULT_LANGUAGE;
}
// language from url
if (isset($_GET['lang'])) {
$currentLanguage = $_GET['lang'];
BizSystem::sessionContext()->setVar("LANG", $currentLanguage);
}
// TODO: user pereference has language setting
BizSystem::sessionContext()->setVar("LANG", $currentLanguage);
I18n::$_langCode = $currentLanguage;
return $currentLanguage;
}