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


PHP XoopsLocale::getLocale方法代码示例

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


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

示例1: header

$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()) {
            $user_handler = $xoops->getHandlerUser();
            $criteria = new Criteria('uid', $uid);
开发者ID:RanLee,项目名称:XoopsCore,代码行数:31,代码来源:common.php

示例2: getLocalizationAssets

 /**
  * Load localization information
  * Folder structure for localization:
  * themes/themefolder/english
  *    - main.php - language definitions
  *    - style.css - localization stylesheet
  *    - script.js - localization script
  *
  * @param string $type language domain (unused?)
  *
  * @return array list of 2 arrays, one
  */
 public function getLocalizationAssets($type = "main")
 {
     $cssAssets = array();
     $jsAssets = array();
     $xoops = \Xoops::getInstance();
     \Xoops\Locale::loadThemeLocale($this);
     $language = \XoopsLocale::getLocale();
     // Load global localization stylesheet if available
     if (\XoopsLoad::fileExists($xoops->path('locale/' . $language . '/style.css'))) {
         $cssAssets[] = $xoops->path('locale/' . $language . '/style.css');
     }
     //$this->addLanguage($type);
     // Load theme localization stylesheet and scripts if available
     if (\XoopsLoad::fileExists($this->path . '/locale/' . $language . '/script.js')) {
         $jsAssets[] = $this->url . '/locale/' . $language . '/script.js';
     }
     if (\XoopsLoad::fileExists($this->path . '/locale/' . $language . '/style.css')) {
         $cssAssets[] = $this->path . '/locale/' . $language . '/style.css';
     }
     return array($cssAssets, $jsAssets);
 }
开发者ID:elitet,项目名称:XoopsCore,代码行数:33,代码来源:XoopsTheme.php

示例3: elseif

        } elseif (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoopsConfig['language'] . '/help/' . $page . '.html')) {
            $helpcontent = $xoops->tpl()->fetch(\XoopsBaseConfig::get('root-path') . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoopsConfig['language'] . '/help/' . $page . '.html');
        } else {
            if (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $module->getVar('dirname', 'e') . '/language/english/help/' . $page . '.html')) {
                $helpcontent = $xoops->tpl()->fetch(\XoopsBaseConfig::get('root-path') . '/modules/' . $module->getVar('dirname', 'e') . '/language/english/help/' . $page . '.html');
            } else {
                $xoops->tpl()->assign('load_error', 1);
            }
        }
        if ($module->getVar('dirname', 'e') != 'system') {
            $xoops->tpl()->assign('help_module', true);
        }
        $xoops->tpl()->assign('helpcontent', $helpcontent);
    } else {
        if ($helpfile = XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $module->getVar('dirname', 'e') . '/locale/' . XoopsLocale::getLocale() . '/help/module_index.html')) {
            $helpcontent = $xoops->tpl()->fetch(\XoopsBaseConfig::get('root-path') . '/modules/' . $module->getVar('dirname', 'e') . '/locale/' . XoopsLocale::getLocale() . '/help/module_index.html');
        } elseif (XoopsLoad::fileExists(\XoopsBaseConfig::get('root-path') . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoops->getConfig('language') . '/help/module_index.html')) {
            $helpcontent = $xoops->tpl()->fetch(\XoopsBaseConfig::get('root-path') . '/modules/' . $module->getVar('dirname', 'e') . '/language/' . $xoops->getConfig('language') . '/help/module_index.html');
        } else {
            $helpcontent = '<p>' . $module->getInfo('description') . '</p>';
        }
        $xoops->tpl()->assign('helpcontent', $helpcontent);
    }
} else {
    $system_breadcrumb->render();
    $criteria = new CriteriaCompo();
    $criteria->setOrder('weight');
    // Get all installed modules
    $installed_mods = $xoops->getHandlerModule()->getObjectsArray($criteria);
    $listed_mods = array();
    $i = 0;
开发者ID:redmexico,项目名称:XoopsCore,代码行数:31,代码来源:help.php


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