本文整理汇总了PHP中SE_Language::_autodetect方法的典型用法代码示例。如果您正苦于以下问题:PHP SE_Language::_autodetect方法的具体用法?PHP SE_Language::_autodetect怎么用?PHP SE_Language::_autodetect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SE_Language
的用法示例。
在下文中一共展示了SE_Language::_autodetect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
SE_Language::_languages();
// SAVE CHANGES
} elseif ($task == "dosave") {
$setting[setting_lang_allow] = $_POST['setting_lang_allow'];
$setting[setting_lang_anonymous] = $_POST['setting_lang_anonymous'];
$setting[setting_lang_autodetect] = $_POST['setting_lang_autodetect'];
$database->database_query("UPDATE se_settings SET setting_lang_allow='{$setting['setting_lang_allow']}',\r\n\t\t\t\t\t\tsetting_lang_anonymous='{$setting['setting_lang_anonymous']}',\r\n\t\t\t\t\t\tsetting_lang_autodetect='{$setting['setting_lang_autodetect']}'");
// RESET LANGUAGE
SE_Language::select($admin);
header("Content-Language: " . SE_Language::info('language_code'));
}
// GET LANGUAGE PACK LIST
$lang_packlist = SE_Language::list_packs();
ksort($lang_packlist);
$lang_packlist = array_values($lang_packlist);
// GET AVAILABLE LOCALE OPTIONS
$locales = array();
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
$result = NULL;
@exec('locale -a', $result);
if (is_array($result)) {
$locales = array_map('trim', $result);
}
}
// ASSIGN VARIABLES AND SHOW ADMIN USER LEVELS PAGE
$smarty->assign('locales', $locales);
$smarty->assign('lang_packlist', $lang_packlist);
$smarty->assign('HTTP_ACCEPT_LANGUAGE', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
$smarty->assign('HTTP_ACCEPT_LANGUAGE_CLEAN', join(', ', array_filter(preg_split('/[;,.q=\\d]+/', $_SERVER['HTTP_ACCEPT_LANGUAGE']))));
$smarty->assign('AUTODETECTED_LANGUAGE', SE_Language::_autodetect($_SERVER['HTTP_ACCEPT_LANGUAGE'], '[default]'));
include "admin_footer.php";