• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP setLang函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中setLang函数的典型用法代码示例。如果您正苦于以下问题:PHP setLang函数的具体用法?PHP setLang怎么用?PHP setLang使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setLang函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct(array $request = array(), array $opt = array())
 {
     parent::__construct($request, $opt);
     $this->fields = $this->defFields();
     $storeVar = isset($_GET['act']) && $_GET['act'] == 'list';
     // if true store the filter variables
     $init = array_key_exists('init', $this->request);
     $reset = array_key_exists('reset', $this->request);
     if ($init || $reset) {
         $storeVar = true;
     }
     $this->id = initVar('id');
     $this->last_id = initVar('last_id');
     $this->parent_act = initVar('parent_act');
     $this->tab_mode = initVar('tab_mode');
     $this->act = initVar('act', 'list');
     $this->do_id = $_SESSION['do_id'];
     $this->gpr_id = initVar('gpr_id');
     $this->order = PageVar('order', '1A', $init, false, $this->baseName, $storeVar);
     $this->pg = PageVar('pg', 0, $init | $reset, false, $this->baseName, $storeVar);
     setLang(R3Locale::getLanguageCode());
     setLangInfo(array('thousands_sep' => "."));
     $this->registerAjaxFunction('submitFormData');
     $this->registerAjaxFunction('askDelGlobalPlainGauge');
 }
开发者ID:r3-gis,项目名称:EcoGIS,代码行数:25,代码来源:obj.global_plain_gauge.php


示例2: __construct

 public function __construct(array $request = array(), array $opt = array())
 {
     parent::__construct($request, $opt);
     $init = array_key_exists('init', $this->request);
     $reset = array_key_exists('reset', $this->request);
     $this->id = initVar('id');
     $this->ge_id = (int) initVar('ge_id');
     $this->gs_id = (int) initVar('gs_id');
     $this->gc_id = initVar('gc_id');
     $this->act = initVar('act', initVar('parent_act', 'mod'));
     $this->parent_act = initVar('parent_act', 'mod');
     $this->kind = strToUpper(initVar('kind'));
     $this->new_udm_divider = initVar('udm_divider');
     $this->merge_municipality_data = PageVar('merge_municipality_data', 'T') == 'T' ? true : false;
     $this->toggle_subcategory = initVar('toggle_subcategory');
     $this->do_id = PageVar('do_id', $_SESSION['do_id'], $init | $reset, false, $this->baseName);
     $this->pr_id = PageVar('pr_id', null, $init | $reset, false, $this->baseName);
     $this->mu_id = PageVar('mu_id', null, $init | $reset, false, $this->baseName);
     $this->bpu_id = PageVar('bpu_id', null, $init | $reset, false, $this->baseName);
     $this->order = PageVar('order', '1A', $init, false, $this->baseName);
     $this->pg = PageVar('pg', 0, $init | $reset, false, $this->baseName);
     setLang(R3Locale::getLanguageCode());
     setLangInfo(array('thousands_sep' => "."));
     $this->registerAjaxFunction('getHelp');
     $this->registerAjaxFunction('toggleSubcategory');
     $this->registerAjaxFunction('updateLastOpenCloseStatus');
 }
开发者ID:r3-gis,项目名称:EcoGIS,代码行数:27,代码来源:obj.global_result_table.php


示例3: userLogin

function userLogin($username, $password, $log = true)
{
    global $USER, $MSG;
    if ($username == "") {
        array_push($MSG, getstring('warning.login.noemail'));
        return false;
    }
    if ($password == "") {
        array_push($MSG, getstring('warning.login.nopassword'));
        return false;
    }
    $USER = new User($username);
    $USER->setUsername($username);
    $USER->password = $password;
    if ($USER instanceof User) {
        if ($USER->validPassword($password)) {
            $_SESSION["session_username"] = $USER->getUsername();
            setcookie("user", $USER->getUsername(), time() + 60 * 60 * 24 * 30, "/");
            setLang($USER->getProp('lang'));
            if ($log) {
                writeToLog('info', 'login', 'user logged in');
            }
            return true;
        } else {
            array_push($MSG, getstring('warning.login.invalid'));
            writeToLog('info', 'loginfailure', 'username: ' . $username);
            unset($USER);
            return false;
        }
    } else {
        return false;
    }
}
开发者ID:nfreear,项目名称:mQuiz,代码行数:33,代码来源:accesslib.php


示例4: testSetLang

 public function testSetLang()
 {
     // set default lang
     setLang("");
     $this->assertEquals(getLang(), "testLang");
     //set lang testLang2
     setLang("testLang2");
     $this->assertEquals(getLang(), "testLang2");
 }
开发者ID:vmizoules,项目名称:ZZTasksPHP,代码行数:9,代码来源:translationTest.php


示例5: __construct

 public function __construct(array $request = array(), array $opt = array())
 {
     parent::__construct($request, $opt);
     $this->fields = $this->defFields();
     $this->act = initVar('act', 'mod');
     $this->do_id = $_SESSION['do_id'];
     setLang(R3Locale::getLanguageCode());
     setLangInfo(array('thousands_sep' => "."));
     $this->registerAjaxFunction('getHelp');
     $this->registerAjaxFunction('submitFormData');
 }
开发者ID:r3-gis,项目名称:EcoGIS,代码行数:11,代码来源:obj.stat_general.php


示例6: __construct

 public function __construct(array $request = array(), array $opt = array())
 {
     parent::__construct($request, $opt);
     $init = array_key_exists('init', $this->request);
     $this->act = initVar('act', 'list');
     $this->sl_id = PageVar('sl_id');
     $this->last_id = initVar('consumption_last_id');
     $this->parent_act = PageVar('parent_act');
     $this->tab_mode = initVar('tab_mode');
     $this->order = PageVar('order', '6A', $init, false, $this->baseName);
     setLang(R3Locale::getLanguageCode());
     setLangInfo(array('thousands_sep' => "."));
 }
开发者ID:r3-gis,项目名称:EcoGIS,代码行数:13,代码来源:obj.street_lighting_consumption.php


示例7: __construct

 public function __construct(array $request = array(), array $opt = array())
 {
     parent::__construct($request, $opt);
     $this->fields = $this->defFields();
     $init = array_key_exists('init', $this->request);
     $reset = array_key_exists('reset', $this->request);
     $this->id = initVar('id');
     $this->act = initVar('act', 'list');
     $this->kind = PageVar('kind');
     $this->em_id = PageVar('em_id', null, $init | $reset, false, $this->baseName);
     $this->tabMode = PageVar('tab_mode', null, $init | $reset, false, $this->baseName);
     setLang(R3Locale::getLanguageCode());
     setLangInfo(array('thousands_sep' => "."));
     $this->registerAjaxFunction('confirm_delete_device');
     $this->registerAjaxFunction('submitFormData');
 }
开发者ID:r3-gis,项目名称:EcoGIS,代码行数:16,代码来源:obj.device.php


示例8: __construct

 public function __construct(array $request = array(), array $opt = array())
 {
     parent::__construct($request, $opt);
     $this->kind = initVar('kind');
     $this->act = initVar('act', 'add');
     $this->mu_id = initVar('mu_id');
     $this->mu_name = initVar('mu_name');
     if ($this->mu_name != '') {
         // Convert municipality text into id
         $db = ezcDbInstance::get();
         $lang = R3Locale::getLanguageID();
         $this->mu_id = (int) $db->query("SELECT mu_id FROM municipality WHERE mu_name_{$lang} ILIKE " . $db->quote($request['mu_name']))->fetchColumn();
     }
     setLang(R3Locale::getLanguageCode());
     $this->registerAjaxFunction('submitFormData');
 }
开发者ID:r3-gis,项目名称:EcoGIS,代码行数:16,代码来源:obj.building_fr_st_cm.php


示例9: __construct

 public function __construct(array $request = array(), array $opt = array())
 {
     parent::__construct($request, $opt);
     $storeVar = isset($_GET['act']) && $_GET['act'] == 'list';
     // if true store the filter variables
     $init = array_key_exists('init', $this->request);
     $reset = array_key_exists('reset', $this->request);
     if ($init || $reset) {
         $storeVar = true;
     }
     $this->gc_id_filter = PageVar('gc_id_filter', null, $init | $reset, false, $this->baseName, $storeVar);
     $this->gp_name = PageVar('gp_name', null, $init | $reset, false, $this->baseName, $storeVar);
     setLang(R3Locale::getLanguageCode());
     setLangInfo(array('thousands_sep' => "."));
     $this->registerAjaxFunction('getHelp');
     $this->registerAjaxFunction('countGaugeAndMonitor');
 }
开发者ID:r3-gis,项目名称:EcoGIS,代码行数:17,代码来源:obj.global_plain_action.php


示例10: __construct

 public function __construct(array $request = array(), array $opt = array())
 {
     parent::__construct($request, $opt);
     $init = array_key_exists('init', $this->request);
     $reset = array_key_exists('reset', $this->request);
     $this->id = initVar('id');
     $this->act = initVar('act', 'list');
     $this->kind = PageVar('kind');
     $this->em_id = PageVar('em_id', null, $init | $reset, false, $this->baseName);
     $this->sl_id = PageVar('sl_id', null, $init | $reset, false, $this->baseName);
     $this->tabMode = PageVar('tab_mode', null, $init | $reset, false, $this->baseName);
     $data = R3EcoGisHelper::getMeterData($_SESSION['do_id'], $this->em_id);
     $this->fields = $this->defFields($data['em_is_production'] == 'T');
     setLang(R3Locale::getLanguageCode());
     setLangInfo(array('thousands_sep' => "."));
     $this->registerAjaxFunction('confirm_delete_consumption');
     $this->registerAjaxFunction('submitFormData');
 }
开发者ID:r3-gis,项目名称:EcoGIS,代码行数:18,代码来源:obj.consumption.php


示例11: __construct

 public function __construct(array $request = array(), array $opt = array())
 {
     parent::__construct($request, $opt);
     $this->fields = $this->defFields();
     $init = array_key_exists('init', $this->request);
     $reset = array_key_exists('reset', $this->request);
     $this->do_id = $_SESSION['do_id'];
     $this->id = initVar('id');
     $this->act = initVar('act', 'list');
     $this->kind = initVar('kind');
     $this->bu_id = initVar('bu_id');
     $this->tabMode = initVar('tab_mode');
     setLang(R3Locale::getLanguageCode());
     setLangInfo(array('thousands_sep' => "."));
     $this->registerAjaxFunction('fetchUDM');
     $this->registerAjaxFunction('getEnergySourceList');
     $this->registerAjaxFunction('getUtilityProductList');
     $this->registerAjaxFunction('confirmDeleteMeter');
     $this->registerAjaxFunction('submitFormData');
 }
开发者ID:r3-gis,项目名称:EcoGIS,代码行数:20,代码来源:obj.meter.php


示例12: __construct

 public function __construct(array $request = array(), array $opt = array())
 {
     parent::__construct($request, $opt);
     $this->id = initVar('id');
     $this->act = initVar('act', 'list');
     $this->tab_mode = initVar('tab_mode');
     $this->kind = initVar('kind');
     $this->ge_id = (int) initVar('ge_id');
     $this->gc_id = (int) initVar('gc_id');
     $this->limit = 0;
     $this->do_id = PageVar('do_id', $_SESSION['do_id'], false, false, $this->baseName);
     setLang(R3Locale::getLanguageCode());
     setLangInfo(array('thousands_sep' => "."));
     $this->fields = $this->defFields();
     $this->registerAjaxFunction('fetchUDM');
     $this->registerAjaxFunction('performEnergySourceRowCalc');
     $this->registerAjaxFunction('confirmDeleteGlobalConsumptionRow');
     $this->registerAjaxFunction('getEnergySource');
     $this->registerAjaxFunction('getEnergyUDM');
     $this->registerAjaxFunction('performActionCatalogCalc');
     $this->registerAjaxFunction('submitFormData');
 }
开发者ID:r3-gis,项目名称:EcoGIS,代码行数:22,代码来源:obj.global_consumption_row.php


示例13: initLang

function initLang()
{
    global $languageArray;
    if (isset($_COOKIE["Language"])) {
        $browerLang = $_COOKIE["Language"];
    } else {
        if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
            $browerLang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
        } else {
            $browerLang = "en";
        }
    }
    if (isset($_SESSION["langindex"])) {
        $index = $_SESSION["langindex"];
    } else {
        $index = array_search($browerLang, $languageArray);
    }
    if ($index) {
        setLang($index);
    } else {
        setLang(0);
    }
}
开发者ID:qichangjun,项目名称:HTMLLearn,代码行数:23,代码来源:language.php


示例14: __construct

 public function __construct(array $request = array(), array $opt = array())
 {
     parent::__construct($request, $opt);
     $this->fields = $this->defFields();
     $storeVar = isset($_GET['act']) && $_GET['act'] == 'list';
     // if true store the filter variables
     $init = array_key_exists('init', $this->request);
     $reset = array_key_exists('reset', $this->request);
     if ($init || $reset) {
         $storeVar = true;
     }
     $this->id = initVar('id');
     if (initVar('sl_id') !== null) {
         $this->id = initVar('sl_id');
     }
     $this->act = initVar('act', 'list');
     $this->last_id = initVar('last_id');
     $this->parent_act = initVar('parent_act');
     $this->do_id = $_SESSION['do_id'];
     $this->pr_id = PageVar('pr_id', null, $init | $reset, false, $this->baseName, $storeVar);
     $this->mu_id = PageVar('mu_id', null, $init | $reset, false, $this->baseName, $storeVar);
     $this->mu_name = PageVar('mu_name', null, $init | $reset, false, $this->baseName, $storeVar);
     $this->st_id = PageVar('st_id', null, $init | $reset, false, $this->baseName, $storeVar);
     $this->st_name = PageVar('st_name', null, $init | $reset, false, $this->baseName, $storeVar);
     $this->sl_full_name = PageVar('sl_full_name', null, $init | $reset, false, $this->baseName, $storeVar);
     $this->sl_to_check = PageVar('sl_to_check', null, $init | $reset, false, $this->baseName, $storeVar);
     $this->order = PageVar('order', '1A', $init, false, $this->baseName, $storeVar);
     $this->pg = PageVar('pg', 0, $init | $reset, false, $this->baseName, $storeVar);
     setLang(R3Locale::getLanguageCode());
     setLangInfo(array('thousands_sep' => "."));
     $this->registerAjaxFunction('getHelp');
     $this->registerAjaxFunction('getMunicipalityList');
     $this->registerAjaxFunction('getStreetList');
     $this->registerAjaxFunction('getStreetLength');
     $this->registerAjaxFunction('confirmDeleteStreetLighting');
     $this->registerAjaxFunction('submitFormData');
 }
开发者ID:r3-gis,项目名称:EcoGIS,代码行数:37,代码来源:obj.street_lighting.php


示例15: __construct

 public function __construct(array $request = array(), array $opt = array())
 {
     parent::__construct($request, $opt);
     $this->fields = array();
     $init = array_key_exists('init', $this->request);
     $reset = array_key_exists('reset', $this->request);
     $this->id = initVar('id');
     $this->act = initVar('act', 'list');
     $this->order = PageVar('order', '1A', $init, false, $this->baseName);
     $this->pg = PageVar('pg', 0, $init | $reset, false, $this->baseName);
     $storeVar = isset($_GET['act']) && $_GET['act'] == 'list' || $reset || $init;
     // if true store the filter variables
     if ($init || $reset) {
         $storeVar = true;
     }
     $this->do_id_filter = (int) PageVar('do_id_filter', null, $init | $reset, false, $this->baseName, $storeVar);
     $this->mu_name_collection = PageVar('mu_name_collection', null, $init | $reset, false, $this->baseName, $storeVar);
     $this->mu_name = PageVar('mu_name', null, $init | $reset, false, $this->baseName, $storeVar);
     setLang(R3Locale::getLanguageCode());
     setLangInfo(array('thousands_sep' => "."));
     $this->registerAjaxFunction('submitFormData');
     $this->registerAjaxFunction('confirmDeleteMunicipalityCollection');
     $this->registerAjaxFunction('getAvailableMunicipalityForCollection');
 }
开发者ID:r3-gis,项目名称:EcoGIS,代码行数:24,代码来源:obj.municipality_collection.php


示例16: __construct

 public function __construct(array $request = array(), array $opt = array())
 {
     parent::__construct($request, $opt);
     $this->fields = array();
     $init = array_key_exists('init', $this->request);
     $reset = array_key_exists('reset', $this->request);
     $this->id = initVar('id');
     $this->act = 'list';
     $this->order = PageVar('order', '1A', $init, false, $this->baseName);
     $this->pg = PageVar('pg', 0, $init | $reset, false, $this->baseName);
     $this->do_id = $_SESSION['do_id'];
     $storeVar = isset($_GET['act']) && $_GET['act'] == 'list' || $reset || $init;
     if ($init || $reset) {
         $storeVar = true;
     }
     $this->us_name_email = PageVar('us_name_email', null, $init | $reset, false, $this->baseName, $storeVar);
     $this->us_status = PageVar('us_status', null, $init | $reset, false, $this->baseName, $storeVar);
     setLang(R3Locale::getLanguageCode());
     setLangInfo(array('thousands_sep' => "."));
     $this->registerAjaxFunction('askEnablePublicUser');
     $this->registerAjaxFunction('askDelPublicUser');
     $this->registerAjaxFunction('enablePublicUser');
     $this->registerAjaxFunction('delPublicUser');
 }
开发者ID:r3-gis,项目名称:EcoGIS,代码行数:24,代码来源:obj.public_user.php


示例17: tsdefine

    tsdefine('THEME_NAME', C('THEME_NAME'));
} else {
    tsdefine('THEME_NAME', 'stv1');
}
//默认静态文件、模版文件目录
tsdefine('THEME_PATH', ADDON_PATH . '/theme/' . THEME_NAME);
tsdefine('THEME_URL', ADDON_URL . '/theme/' . THEME_NAME);
tsdefine('THEME_PUBLIC_PATH', THEME_PATH . '/_static');
tsdefine('THEME_PUBLIC_URL', THEME_URL . '/_static');
tsdefine('APP_PUBLIC_PATH', APP_PATH . '/_static');
tsdefine('APP_PUBLIC_URL', APP_URL . '/_static');
tsdefine('APP_TPL_PATH', APP_PATH . '/Tpl/default');
tsdefine('APP_TPL_URL', APP_URL . '/Tpl/default');
tsdefine('CANVAS_PATH', SITE_PATH . '/config/canvas/');
//设置语言包
setLang();
//载入应用函数库
if (file_exists(APP_COMMON_PATH . '/common.php')) {
    tsload(APP_COMMON_PATH . '/common.php');
}
//合并应用配置
if (file_exists(APP_CONFIG_PATH . '/config.php')) {
    tsconfig(include APP_CONFIG_PATH . '/config.php');
}
//根据应用配置重定义以下常量
if (C('THEME_NAME')) {
    tsdefine('THEME_NAME', C('THEME_NAME'));
}
//根据应用配置重定义以下常量
if (C('APP_TPL_PATH')) {
    tsdefine('APP_TPL_PATH', C('APP_TPL_PATH'));
开发者ID:a349944418,项目名称:kaopu,代码行数:31,代码来源:OpenSociax.php


示例18: __construct

 public function __construct(array $request = array(), array $opt = array())
 {
     parent::__construct($request, $opt);
     $init = array_key_exists('init', $this->request);
     $reset = array_key_exists('reset', $this->request);
     $this->id = initVar('id');
     $this->act = initVar('act', 'list');
     $this->order = PageVar('order', '1A', $init, false, $this->baseName);
     $this->pg = PageVar('pg', 0, $init | $reset, false, $this->baseName);
     $this->fields = $this->defFields();
     setLang(R3Locale::getLanguageCode());
     setLangInfo(array('thousands_sep' => "."));
     $this->registerAjaxFunction('getHelp');
     $this->registerAjaxFunction('validateDomain');
     $this->registerAjaxFunction('getSRIDDesc');
     $this->registerAjaxFunction('getMunicipality');
     $this->registerAjaxFunction('submitFormData');
     $this->registerAjaxFunction('confirmDeleteCustomer');
     $this->registerAjaxFunction('vacuum');
     $this->registerAjaxFunction('create_grid');
 }
开发者ID:r3-gis,项目名称:EcoGIS,代码行数:21,代码来源:obj.customer.php


示例19: __construct

 public function __construct(array $request = array(), array $opt = array())
 {
     parent::__construct($request, $opt);
     $this->fields = $this->defFields();
     $storeVar = isset($_GET['act']) && $_GET['act'] == 'list';
     // if true store the filter variables
     $init = array_key_exists('init', $this->request);
     $reset = array_key_exists('reset', $this->request);
     if ($init || $reset) {
         $storeVar = true;
     }
     $this->id = (int) initVar('id');
     $this->last_id = initVar('last_id');
     $this->act = initVar('act', 'list');
     $this->parent_act = initVar('parent_act');
     $this->do_id = PageVar('do_id', $_SESSION['do_id'], $init | $reset, false, $this->baseName, $storeVar);
     $this->pr_id = PageVar('pr_id', null, $init | $reset, false, $this->baseName, $storeVar);
     $this->mu_id = PageVar('mu_id', null, $init | $reset, false, $this->baseName, $storeVar);
     $this->mu_name = PageVar('mu_name', null, $init | $reset, false, $this->baseName, $storeVar);
     $this->gst_name = PageVar('gst_name', null, $init | $reset, false, $this->baseName, $storeVar);
     $this->order = PageVar('order', '1A', $init, false, $this->baseName, $storeVar);
     $this->pg = PageVar('pg', 0, $init | $reset, false, $this->baseName, $storeVar);
     setLang(R3Locale::getLanguageCode());
     setLangInfo(array('thousands_sep' => "."));
     $this->registerAjaxFunction('getHelp');
     $this->registerAjaxFunction('loadGE_GS');
     $this->registerAjaxFunction('submitFormData');
     $this->registerAjaxFunction('exportPAES');
     $this->registerAjaxFunction('exportPAESDlg');
     $this->registerAjaxFunction('getExportPAESStatus');
     $this->registerAjaxFunction('askDelGlobalStrategy');
 }
开发者ID:r3-gis,项目名称:EcoGIS,代码行数:32,代码来源:obj.global_strategy.php


示例20: init

 function init()
 {
     if (!oreInstall::isInstalled() && !(Yii::app()->controller->module && Yii::app()->controller->module->id == 'install')) {
         $this->redirect(array('/install'));
     }
     setLang();
     $modulesToCheck = ConfigurationModel::getModulesList();
     foreach ($modulesToCheck as $module) {
         if (param('module_enabled_' . $module) === null) {
             ConfigurationModel::createValue('module_enabled_' . $module, 0);
             Yii::app()->params['module_enabled_' . $module] = 0;
         }
     }
     unset($modulesToCheck);
     $this->assetsGenPath = Yii::getPathOfAlias('webroot.assets');
     $this->assetsGenUrl = Yii::app()->getBaseUrl(true) . '/assets/';
     Yii::app()->user->setState('menu_active', '');
     $this->pageTitle = tt('siteName', 'seo');
     $this->pageKeywords = tt('siteKeywords', 'seo');
     $this->pageDescription = tt('siteDescription', 'seo');
     Yii::app()->name = $this->pageTitle;
     $this->defaultTheme = Themes::getDefaultTheme();
     if (!$this->defaultTheme) {
         $this->defaultTheme = 'classic';
     }
     Yii::app()->theme = $this->defaultTheme;
     $this->baseUrl = Yii::app()->baseUrl;
     $this->baseThemeUrl = Yii::app()->theme->baseUrl;
     if (Yii::app()->getModule('menumanager')) {
         if (!(Yii::app()->controller->module && Yii::app()->controller->module->id == 'install')) {
             $this->infoPages = Menu::getMenuItems(true, 2);
         }
     }
     $subItems = array();
     if (!Yii::app()->user->isGuest) {
         $subItems = HUser::getMenu();
     }
     $this->aData['userCpanelItems'] = Menu::getMenuItems(true, 1);
     $this->aData['userCpanelItems'][] = array('label' => tt('Reserve apartment', 'common'), 'url' => array('/booking/main/mainform'), 'visible' => Yii::app()->user->checkAccess('backend_access') === false, 'linkOptions' => array('class' => 'fancy'), 'itemOptions' => array('class' => 'depth_zero'));
     $this->aData['userCpanelItems'][] = array('label' => Yii::t('common', 'Control panel'), 'url' => array('/usercpanel/main/index'), 'visible' => Yii::app()->user->checkAccess('backend_access') === false, 'items' => $subItems, 'itemOptions' => array('class' => 'depth_zero'), 'submenuOptions' => array('class' => 'sub_menu_dropdown'));
     if (!Yii::app()->user->isGuest) {
         $user = HUser::getModel();
         $this->aData['userCpanelItems'][] = array('label' => '(' . $user->username . ') ' . tt('Logout', 'common'), 'url' => array('/site/logout'), 'itemOptions' => array('class' => 'depth_zero'));
     }
     $this->aData['topMenuItems'] = $this->infoPages;
     // comparison list
     if (issetModule('comparisonList')) {
         if (!Yii::app()->user->isGuest) {
             $resultCompare = ComparisonList::model()->findAllByAttributes(array('user_id' => Yii::app()->user->id));
         } else {
             $resultCompare = ComparisonList::model()->findAllByAttributes(array('session_id' => Yii::app()->session->sessionId));
         }
         if ($resultCompare) {
             foreach ($resultCompare as $item) {
                 $this->apInComparison[] = $item->apartment_id;
             }
         }
     }
     $this->currentUserIp = Yii::app()->request->getUserHostAddress();
     $this->currentUserIpLong = ip2long($this->currentUserIp);
     $this->datePickerLang = Yii::app()->language;
     if ($this->datePickerLang == 'en') {
         $this->datePickerLang = 'en-GB';
     }
     if (demo()) {
         if (isset($_GET['theme']) && array_key_exists($_GET['theme'], Themes::getColorThemesList())) {
             $theme = $_GET['theme'];
             $cookie = new CHttpCookie('theme', $theme);
             $cookie->expire = time() + 86400;
             Yii::app()->request->cookies['theme'] = $cookie;
         }
     }
     parent::init();
 }
开发者ID:barricade86,项目名称:raui,代码行数:74,代码来源:Controller.php



注:本文中的setLang函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP setLanguage函数代码示例发布时间:2022-05-15
下一篇:
PHP setIt函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap