当前位置: 首页>>代码示例>>PHP>>正文


PHP Context::loadLangSelected方法代码示例

本文整理汇总了PHP中Context::loadLangSelected方法的典型用法代码示例。如果您正苦于以下问题:PHP Context::loadLangSelected方法的具体用法?PHP Context::loadLangSelected怎么用?PHP Context::loadLangSelected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Context的用法示例。


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

示例1: _getAgreement

 function _getAgreement()
 {
     $agreement_file = _XE_PATH_ . 'files/authentication/agreement_' . Context::get('lang_type') . '.txt';
     if (is_readable($agreement_file)) {
         return FileHandler::readFile($agreement_file);
     }
     $db_info = Context::getDBInfo();
     $agreement_file = _XE_PATH_ . 'files/authentication/agreement_' . $db_info->lang_type . '.txt';
     if (is_readable($agreement_file)) {
         return FileHandler::readFile($agreement_file);
     }
     $lang_selected = Context::loadLangSelected();
     foreach ($lang_selected as $key => $val) {
         $agreement_file = _XE_PATH_ . 'files/authentication/agreement_' . $key . '.txt';
         if (is_readable($agreement_file)) {
             return FileHandler::readFile($agreement_file);
         }
     }
     return null;
 }
开发者ID:umjinsun12,项目名称:dngshin,代码行数:20,代码来源:authentication.model.php

示例2: dispTextyleToolConfigInfo

 function dispTextyleToolConfigInfo()
 {
     Context::set('langs', Context::loadLangSelected());
     Context::set('time_zone_list', $GLOBALS['time_zone']);
     Context::set('time_zone', $GLOBALS['_time_zone']);
 }
开发者ID:google-code-backups,项目名称:xe-textyle,代码行数:6,代码来源:textyle.view.php

示例3: dispAdminConfigGeneral

 /**
  * Display Configuration(settings) page
  * @return void
  */
 function dispAdminConfigGeneral()
 {
     Context::loadLang('modules/install/lang');
     $db_info = Context::getDBInfo();
     Context::set('selected_lang', $db_info->lang_type);
     if (strpos($db_info->default_url, 'xn--') !== FALSE) {
         $db_info->default_url = Context::decodeIdna($db_info->default_url);
     }
     Context::set('default_url', $db_info->default_url);
     Context::set('langs', Context::loadLangSupported());
     // site lock
     Context::set('IP', $_SERVER['REMOTE_ADDR']);
     if (!$db_info->sitelock_title) {
         $db_info->sitelock_title = 'Maintenance in progress...';
     }
     if (!in_array('127.0.0.1', $db_info->sitelock_whitelist)) {
         $db_info->sitelock_whitelist[] = '127.0.0.1';
     }
     if (!in_array($_SERVER['REMOTE_ADDR'], $db_info->sitelock_whitelist)) {
         $db_info->sitelock_whitelist[] = $_SERVER['REMOTE_ADDR'];
     }
     $db_info->sitelock_whitelist = array_unique($db_info->sitelock_whitelist);
     Context::set('remote_addr', $_SERVER['REMOTE_ADDR']);
     Context::set('use_sitelock', $db_info->use_sitelock);
     Context::set('sitelock_title', $db_info->sitelock_title);
     Context::set('sitelock_message', htmlspecialchars($db_info->sitelock_message, ENT_COMPAT | ENT_HTML401, 'UTF-8', false));
     $whitelist = implode("\r\n", $db_info->sitelock_whitelist);
     Context::set('sitelock_whitelist', $whitelist);
     if ($db_info->admin_ip_list) {
         $admin_ip_list = implode("\r\n", $db_info->admin_ip_list);
     } else {
         $admin_ip_list = '';
     }
     Context::set('admin_ip_list', $admin_ip_list);
     Context::set('lang_selected', Context::loadLangSelected());
     $oAdminModel = getAdminModel('admin');
     $favicon_url = $oAdminModel->getFaviconUrl();
     $mobicon_url = $oAdminModel->getMobileIconUrl();
     Context::set('favicon_url', $favicon_url . '?' . $_SERVER['REQUEST_TIME']);
     Context::set('mobicon_url', $mobicon_url . '?' . $_SERVER['REQUEST_TIME']);
     $oDocumentModel = getModel('document');
     $config = $oDocumentModel->getDocumentConfig();
     Context::set('thumbnail_type', $config->thumbnail_type);
     $oModuleModel = getModel('module');
     $config = $oModuleModel->getModuleConfig('module');
     Context::set('siteTitle', $config->siteTitle);
     Context::set('htmlFooter', htmlspecialchars($config->htmlFooter));
     // embed filter
     require_once _XE_PATH_ . 'classes/security/EmbedFilter.class.php';
     $oEmbedFilter = EmbedFilter::getInstance();
     context::set('embed_white_object', implode(PHP_EOL, $oEmbedFilter->whiteUrlList));
     context::set('embed_white_iframe', implode(PHP_EOL, $oEmbedFilter->whiteIframeUrlList));
     $columnList = array('modules.mid', 'modules.browser_title', 'sites.index_module_srl');
     $start_module = $oModuleModel->getSiteInfo(0, $columnList);
     Context::set('start_module', $start_module);
     Context::set('pwd', $pwd);
     $this->setTemplateFile('config_general');
     $security = new Security();
     $security->encodeHTML('news..', 'released_version', 'download_link', 'selected_lang', 'module_list..', 'module_list..author..', 'addon_list..', 'addon_list..author..', 'start_module.');
 }
开发者ID:kimkucheol,项目名称:xe-core,代码行数:64,代码来源:admin.admin.view.php

示例4: _compile

 /**
  * Compile a xml_file
  * @return void
  */
 function _compile()
 {
     $lang_selected = Context::loadLangSelected();
     $this->lang_types = array_keys($lang_selected);
     // read xml file
     $buff = FileHandler::readFile($this->xml_file);
     $buff = str_replace('xml:lang', 'xml_lang', $buff);
     // xml parsing
     $xml_obj = parent::parse($buff);
     $item = $xml_obj->lang->item;
     if (!is_array($item)) {
         $item = array($item);
     }
     foreach ($item as $i) {
         $this->_parseItem($i, $var = '$lang->%s');
     }
 }
开发者ID:relip,项目名称:xe-core,代码行数:21,代码来源:XmlLangParser.class.php

示例5: _getAgreement

 function _getAgreement()
 {
     $agreement_file = _XE_PATH_ . 'files/member_extra_info/agreement_' . Context::get('lang_type') . '.txt';
     if (is_readable($agreement_file)) {
         return FileHandler::readFile($agreement_file);
     }
     $agreement_file = _XE_PATH_ . 'files/member_extra_info/agreement_' . config('locale.default_lang') . '.txt';
     if (is_readable($agreement_file)) {
         return FileHandler::readFile($agreement_file);
     }
     $lang_selected = Context::loadLangSelected();
     foreach ($lang_selected as $key => $val) {
         $agreement_file = _XE_PATH_ . 'files/member_extra_info/agreement_' . $key . '.txt';
         if (is_readable($agreement_file)) {
             return FileHandler::readFile($agreement_file);
         }
     }
     return null;
 }
开发者ID:rhymix,项目名称:rhymix,代码行数:19,代码来源:member.model.php

示例6: dispAdminConfigGeneral

 /**
  * Display Configuration(settings) page
  * @return void
  */
 function dispAdminConfigGeneral()
 {
     Context::loadLang('modules/install/lang');
     $db_info = Context::getDBInfo();
     Context::set('selected_lang', $db_info->lang_type);
     Context::set('default_url', $db_info->default_url);
     Context::set('langs', Context::loadLangSupported());
     Context::set('lang_selected', Context::loadLangSelected());
     $admin_ip_list = preg_replace("/[,]+/", "\r\n", $db_info->admin_ip_list);
     Context::set('admin_ip_list', $admin_ip_list);
     $oAdminModel =& getAdminModel('admin');
     $favicon_url = $oAdminModel->getFaviconUrl();
     $mobicon_url = $oAdminModel->getMobileIconUrl();
     Context::set('favicon_url', $favicon_url);
     Context::set('mobicon_url', $mobicon_url);
     $oDocumentModel =& getModel('document');
     $config = $oDocumentModel->getDocumentConfig();
     Context::set('thumbnail_type', $config->thumbnail_type);
     Context::set('IP', $_SERVER['REMOTE_ADDR']);
     $oModuleModel =& getModel('module');
     $config = $oModuleModel->getModuleConfig('module');
     Context::set('htmlFooter', $config->htmlFooter);
     $columnList = array('modules.mid', 'modules.browser_title', 'sites.index_module_srl');
     $start_module = $oModuleModel->getSiteInfo(0, $columnList);
     Context::set('start_module', $start_module);
     Context::set('pwd', $pwd);
     $this->setTemplateFile('config_general');
     $security = new Security();
     $security->encodeHTML('news..', 'released_version', 'download_link', 'selected_lang', 'module_list..', 'module_list..author..', 'addon_list..', 'addon_list..author..', 'start_module.');
 }
开发者ID:relip,项目名称:xe-core,代码行数:34,代码来源:admin.admin.view.php

示例7: makeCacheDefinedLangCode

 /**
  * @brief Save the file of user-defined language code
  */
 function makeCacheDefinedLangCode($site_srl = 0)
 {
     $args = new stdClass();
     // Get the language file of the current site
     if (!$site_srl) {
         $site_module_info = Context::get('site_module_info');
         $args->site_srl = (int) $site_module_info->site_srl;
     } else {
         $args->site_srl = $site_srl;
     }
     $output = executeQueryArray('module.getLang', $args);
     if (!$output->toBool() || !$output->data) {
         return;
     }
     // Set the cache directory
     $cache_path = _XE_PATH_ . 'files/cache/lang_defined/';
     FileHandler::makeDir($cache_path);
     $langMap = array();
     foreach ($output->data as $val) {
         $langMap[$val->lang_code][$val->name] = $val->value;
     }
     $lang_supported = Context::loadLangSelected();
     $defaultLang = config('locale.default_lang');
     if (!is_array($langMap[$defaultLang])) {
         $langMap[$defaultLang] = array();
     }
     foreach ($lang_supported as $langCode => $langName) {
         if (!is_array($langMap[$langCode])) {
             $langMap[$langCode] = array();
         }
         $langMap[$langCode] += $langMap[$defaultLang];
         foreach ($lang_supported as $targetLangCode => $targetLangName) {
             if ($langCode == $targetLangCode || $langCode == $defaultLang) {
                 continue;
             }
             if (!is_array($langMap[$targetLangCode])) {
                 $langMap[$targetLangCode] = array();
             }
             $langMap[$langCode] += $langMap[$targetLangCode];
         }
         $buff = array("<?php if(!defined('__XE__')) exit();");
         foreach ($langMap[$langCode] as $code => $value) {
             $buff[] = sprintf('$lang[\'%s\'] = \'%s\';', $code, addcslashes($value, "'"));
         }
         if (!@file_put_contents(sprintf('%s/%d.%s.php', $cache_path, $args->site_srl, $langCode), join(PHP_EOL, $buff), LOCK_EX)) {
             return;
         }
     }
 }
开发者ID:kkkyyy03,项目名称:coffeemix,代码行数:52,代码来源:module.admin.controller.php

示例8: dispShopToolConfigInfo

    /**
     * Change shop configuration from backend
     */
    public function dispShopToolConfigInfo(){

        $currencies = require_once(_XE_PATH_.'modules/shop/shop.currencies.php');
        Context::set('currencies',$currencies);

        Context::set('langs', Context::loadLangSelected());

        Context::set('time_zone_list', $GLOBALS['time_zone']);
        Context::set('time_zone', $GLOBALS['_time_zone']);
    }
开发者ID:haegyung,项目名称:xe-module-shop,代码行数:13,代码来源:shop.view.php

示例9: dispAdminConfig

 /**
  * @brief 관리자 설정
  **/
 function dispAdminConfig()
 {
     $db_info = Context::getDBInfo();
     Context::set('selected_lang', $db_info->lang_type);
     Context::set('default_url', $db_info->default_url);
     Context::set('langs', Context::loadLangSupported());
     Context::set('lang_selected', Context::loadLangSelected());
     Context::set('ftp_info', Context::getFTPInfo());
     $site_args->site_srl = 0;
     $output = executeQuery('module.getSiteInfo', $site_args);
     Context::set('start_module', $output->data);
     Context::set('layout', 'none');
     $this->setTemplateFile('config');
 }
开发者ID:hottaro,项目名称:xpressengine,代码行数:17,代码来源:admin.admin.view.php


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