本文整理汇总了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);
示例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);
}
示例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;