當前位置: 首頁>>代碼示例>>PHP>>正文


PHP XoopsLocale::getLegacyLanguage方法代碼示例

本文整理匯總了PHP中XoopsLocale::getLegacyLanguage方法的典型用法代碼示例。如果您正苦於以下問題:PHP XoopsLocale::getLegacyLanguage方法的具體用法?PHP XoopsLocale::getLegacyLanguage怎麽用?PHP XoopsLocale::getLegacyLanguage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在XoopsLocale的用法示例。


在下文中一共展示了XoopsLocale::getLegacyLanguage方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: loadLanguage

 /**
  * @param string $name
  */
 public function loadLanguage($name)
 {
     $helper = Menus::getInstance();
     $language = XoopsLocale::getLegacyLanguage();
     $path = $helper->path("decorators/{$name}/language");
     if (!($ret = XoopsLoad::loadFile("{$path}/{$language}/decorator.php"))) {
         $ret = XoopsLoad::loadFile("{$path}/english/decorator.php");
     }
     return $ret;
 }
開發者ID:ming-hai,項目名稱:XoopsCore,代碼行數:13,代碼來源:decorator.php

示例2: loadLanguage

 /**
  * @param   string   $name       Name of language file to be loaded, without extension
  * @param   mixed    $domain     string: Module dirname; global language file will be loaded if $domain is set to 'global' or not specified
  *                               array:  example; array('Frameworks/moduleclasses/moduleadmin')
  * @param   string   $language   Language to be loaded, current language content will be loaded if not specified
  *
  * @return  boolean
  */
 public static function loadLanguage($name, $domain = '', $language = null)
 {
     if (empty($name)) {
         return false;
     }
     $language = empty($language) ? XoopsLocale::getLegacyLanguage() : $language;
     // expanded domain to multiple categories, e.g. module:system, framework:filter, etc.
     if (empty($domain) || 'global' == $domain) {
         $path = '';
     } else {
         $path = is_array($domain) ? array_shift($domain) : "modules/{$domain}";
     }
     $xoops = Xoops::getInstance();
     $fullPath = $xoops->path("{$path}/language/{$language}/{$name}.php");
     if (!($ret = XoopsLoad::loadFile($fullPath))) {
         $fullPath2 = $xoops->path("{$path}/language/english/{$name}.php");
         $ret = XoopsLoad::loadFile($fullPath2);
     }
     return $ret;
 }
開發者ID:redmexico,項目名稱:XoopsCore,代碼行數:28,代碼來源:Locale.php

示例3: loadLanguage

 /**
  * XOOPS language loader wrapper
  * Temporary solution, not encouraged to use
  *
  * @param string $name     Name of language file to be loaded, without extension
  * @param mixed  $domain   string: Module dirname; global language file will be loaded if
  *                           $domain is set to 'global' or not specified
  *                          array:  example; array('Frameworks/moduleclasses/moduleadmin')
  * @param string $language Language to be loaded, current language content will be loaded if not specified
  *
  * @return  boolean
  */
 public function loadLanguage($name, $domain = '', $language = null)
 {
     if (empty($name)) {
         return false;
     }
     $language = empty($language) ? XoopsLocale::getLegacyLanguage() : $language;
     // expanded domain to multiple categories, e.g. module:Fsystem, framework:filter, etc.
     if (empty($domain) || 'global' === $domain) {
         $path = '';
     } else {
         $path = is_array($domain) ? array_shift($domain) . '/' : "modules/{$domain}/";
     }
     $path .= 'language';
     if (!XoopsLoad::fileExists($file = $this->path("{$path}/{$language}/{$name}.php"))) {
         if (!XoopsLoad::fileExists($file = $this->path("{$path}/english/{$name}.php"))) {
             return false;
         }
     }
     $ret = (include_once $file);
     return $ret;
 }
開發者ID:elitet,項目名稱:XoopsCore,代碼行數:33,代碼來源:Xoops.php

示例4: _loadEditor

 /**
  * XoopsEditorHandler::_loadEditor()
  *
  * @param string $name
  * @param mixed $options
  * @return XoopsEditor|null
  */
 private function _loadEditor($name, $options = null)
 {
     $xoops = Xoops::getInstance();
     $editor = null;
     if (empty($name) || !array_key_exists($name, $this->getList())) {
         return $editor;
     }
     $editor_path = $this->root_path . '/' . $name;
     if (XoopsLoad::fileExists($file = $editor_path . '/language/' . XoopsLocale::getLegacyLanguage() . '.php')) {
         include_once $file;
     } else {
         if (XoopsLoad::fileExists($file = $editor_path . '/language/english.php')) {
             include_once $file;
         }
     }
     if (XoopsLoad::fileExists($file = $editor_path . '/editor_registry.php')) {
         include $file;
     } else {
         return $editor;
     }
     if (empty($config['order'])) {
         return $editor;
     }
     include_once $config['file'];
     $editor = new $config['class']($options);
     return $editor;
 }
開發者ID:redmexico,項目名稱:XoopsCore,代碼行數:34,代碼來源:xoopseditor.php

示例5: isset

 */
$xFrameOptions = isset($xoopsConfig['xFrameOptions']) ? $xoopsConfig['xFrameOptions'] : 'sameorigin';
$xoops->events()->triggerEvent('core.include.common.xframeoption');
if (!headers_sent() && !empty($xFrameOptions)) {
    header('X-Frame-Options: ' . $xFrameOptions);
}
/**
 * Check Bad Ip Addressed against database and block bad ones, requires configs loaded
 */
$xoops->security()->checkBadips();
/**
 * Load Language settings and defines
 */
$xoops->loadLocale();
//For legacy
$xoops->setConfig('language', XoopsLocale::getLegacyLanguage());
date_default_timezone_set(XoopsLocale::getTimezone());
setlocale(LC_ALL, XoopsLocale::getLocale());
/**
 * User Sessions
 */
$member_handler = $xoops->getHandlerMember();
$xoops->session()->sessionStart();
/**
 * Gather some info about the logged in user
 */
if ($xoops->session()->has('xoopsUserId')) {
    $uid = $xoops->session()->get('xoopsUserId');
    $xoops->user = $member_handler->getUser($uid);
    if ($xoops->user instanceof \XoopsUser) {
        if ((int) $xoops->user->getVar('last_login') + 60 * 5 < time()) {
開發者ID:RanLee,項目名稱:XoopsCore,代碼行數:31,代碼來源:common.php


注:本文中的XoopsLocale::getLegacyLanguage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。