当前位置: 首页>>代码示例>>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;未经允许,请勿转载。