本文整理汇总了PHP中FWLanguage::defaultLangId方法的典型用法代码示例。如果您正苦于以下问题:PHP FWLanguage::defaultLangId方法的具体用法?PHP FWLanguage::defaultLangId怎么用?PHP FWLanguage::defaultLangId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FWLanguage
的用法示例。
在下文中一共展示了FWLanguage::defaultLangId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Loads the language config from the database
*
* This used to be in __construct but is also
* called from core/language.class.php to reload
* the config, so core/settings.class.php can
* rewrite .htaccess (virtual lang dirs).
*/
static function init()
{
global $_CONFIG, $objDatabase;
$objResult = $objDatabase->Execute("\n SELECT id, lang, name, charset, themesid,\n frontend, backend, is_default\n FROM " . DBPREFIX . "languages\n ORDER BY id ASC");
if ($objResult) {
// setting full to true for update
$full = true;
while (!$objResult->EOF) {
self::$arrLanguages[$objResult->fields['id']] = array('id' => $objResult->fields['id'], 'lang' => $objResult->fields['lang'], 'name' => $objResult->fields['name'], 'charset' => $objResult->fields['charset'], 'themesid' => $objResult->fields['themesid'], 'frontend' => $objResult->fields['frontend'], 'backend' => $objResult->fields['backend'], 'is_default' => $objResult->fields['is_default'], 'fallback' => '');
if (!$full && $objResult->fields['is_default'] != 'true') {
self::$arrLanguages[$objResult->fields['id']]['frontend'] = 0;
self::$arrLanguages[$objResult->fields['id']]['backend'] = 0;
}
if ($objResult->fields['is_default'] == 'true') {
self::$defaultLangId = $objResult->fields['id'];
}
$objResult->MoveNext();
}
}
}
示例2: init
/**
* Loads the language config from the database
*
* This used to be in __construct but is also
* called from core/language.class.php to reload
* the config, so core/settings.class.php can
* rewrite .htaccess (virtual lang dirs).
*/
static function init()
{
global $_CONFIG, $objDatabase;
$objResult = $objDatabase->Execute("\n SELECT id, lang, name, charset, themesid,\n frontend, backend, is_default, fallback\n FROM " . DBPREFIX . "languages\n ORDER BY id ASC");
if ($objResult) {
$license = \Cx\Core_Modules\License\License::getCached($_CONFIG, $objDatabase);
$license->check();
$full = $license->isInLegalComponents('fulllanguage');
while (!$objResult->EOF) {
self::$arrLanguages[$objResult->fields['id']] = array('id' => $objResult->fields['id'], 'lang' => $objResult->fields['lang'], 'name' => $objResult->fields['name'], 'charset' => $objResult->fields['charset'], 'themesid' => $objResult->fields['themesid'], 'frontend' => $objResult->fields['frontend'], 'backend' => $objResult->fields['backend'], 'is_default' => $objResult->fields['is_default'], 'fallback' => $objResult->fields['fallback']);
if (!$full && $objResult->fields['is_default'] != 'true') {
self::$arrLanguages[$objResult->fields['id']]['frontend'] = 0;
self::$arrLanguages[$objResult->fields['id']]['backend'] = 0;
}
if ($objResult->fields['is_default'] == 'true') {
self::$defaultLangId = $objResult->fields['id'];
}
$objResult->MoveNext();
}
}
}