本文整理汇总了PHP中check_language函数的典型用法代码示例。如果您正苦于以下问题:PHP check_language函数的具体用法?PHP check_language怎么用?PHP check_language使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_language函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
function add($pass_lang_check = false, $act_as_admin = false)
{
global $sess, $title, $url, $description, $mytrail, $auth, $reloadparent, $glob_language_name;
if (!defined("SPELLING_INC")) {
include "commonapi/spelling.inc";
}
if (!defined("DIRECTORY_NOTIFICATION_INC")) {
}
include "messages/directory_notification.inc";
if (!check_language($description, $glob_language_name) and !$pass_lang_check) {
print_bad_lang($title, $url, $description, $reloadparent);
exit;
}
// die("Blepp: ".$mytrail['id']);
$sess->unregister("formdata");
$obj['trail'] = $mytrail['id'];
$obj['title'] = $title;
$obj['description'] = $description;
$obj['url'] = $url;
$obj['owner'] = $auth->auth["uid"];
add_link_ex($obj, true);
if ($reloadparent == 1) {
Header("Location: " . $sess->url($mytrail['path'] . "?reloadparent=1"));
} else {
Header("Location: " . $sess->url($mytrail['path']));
}
}
示例2: __construct
public function __construct()
{
parent::__construct();
$this->lang->load('office_language', check_language());
if ($this->session->has_userdata('user_logged_in')) {
$this->_UserLoggedIn = true;
}
if (!check_module_active($this->uri->rsegment(1))) {
log_message('info', 'MODULE SYSTEM: Call offline Module');
return show_error('Модуль не доступен');
}
}
示例3: array
exit;
}
if (!isset($adminname) || !isset($adminpass) || !isset($adminmail) || $adminmail == "" || $adminname == "" || $adminpass == "" || $adminpass != $adminpass2) {
$content = "<p>" . _INSTALL_L41 . "</p>\n";
$b_back = array('', _INSTALL_L112);
include 'install_tpl.php';
exit;
}
include_once "../mainfile.php";
//include_once './include/createtables2.php';
include_once './makedata.php';
include_once './class/dbmanager.php';
$dbm = new db_manager();
include_once './class/cachemanager.php';
$cm = new cache_manager();
$language = check_language($language);
if (file_exists("./language/" . $language . "/install2.php")) {
include_once "./language/" . $language . "/install2.php";
} elseif (file_exists("./language/english/install2.php")) {
include_once "./language/english/install2.php";
$language = 'english';
} else {
echo 'no language file (install2.php).';
exit;
}
//$tables = array();
$result = $dbm->queryFromFile('./sql/' . XOOPS_DB_TYPE . '.data.sql');
$result = $dbm->queryFromFile('./language/' . $language . '/' . XOOPS_DB_TYPE . '.lang.data.sql');
$group = make_groups($dbm);
$result = make_data($dbm, $cm, $adminname, $adminpass, $adminmail, $language, $group);
$content = $dbm->report();
示例4: die
if (!is_file("{$incpath}/setup.php")) {
die("config.inc.php does not exist or is not configured correctly. Please re-install setup.php and create/fix your config.");
} else {
# common.php is indirectly included in setup.php (via upgrade.php) - avoid endless redirect loop
if (!preg_match('/setup\\.php$/', $_SERVER['SCRIPT_NAME'])) {
header("Location: setup.php");
exit(0);
}
}
}
$incpath = dirname(__FILE__);
ini_get('magic_quotes_gpc') ? ini_set('magic_quotes_runtime', '0') : '1';
ini_get('magic_quotes_gpc') ? ini_set('magic_quotes_sybase', '0') : '1';
if (ini_get('register_globals')) {
die("Please turn off register_globals; edit your php.ini");
}
require_once "{$incpath}/variables.inc.php";
if (!is_file("{$incpath}/config.inc.php")) {
// incorrectly setup...
incorrect_setup();
}
require_once "{$incpath}/config.inc.php";
if (isset($CONF['configured'])) {
if ($CONF['configured'] == FALSE) {
incorrect_setup();
}
}
require_once "{$incpath}/languages/language.php";
require_once "{$incpath}/functions.inc.php";
require_once "{$incpath}/languages/" . check_language() . ".lang";
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */
示例5: size
$details .= 'p' . $r['probid'] . ": testcase #" . $r['rank'] . " output size (" . printsize($r['size']) . ") exceeds output_limit\n";
}
$has_errors = $details != '';
$probs = $DB->q("TABLE SELECT probid, cid FROM contestproblem WHERE color IS NULL");
foreach ($probs as $probdata) {
$details .= 'p' . $probdata['probid'] . " in contest c" . $probdata['cid'] . ": has no color\n";
}
result('problems, languages, teams', 'Problems integrity', $details == '' ? 'O' : ($has_errors ? 'E' : 'W'), $details);
flushresults();
// LANGUAGES
$res = $DB->q('SELECT * FROM language ORDER BY langid');
$details = '';
$langseverity = 'W';
while ($row = $res->next()) {
$CHECKER_ERRORS = array();
check_language($row);
if (count($CHECKER_ERRORS) > 0) {
foreach ($CHECKER_ERRORS as $chk_err) {
$details .= $row['langid'] . ': ' . $chk_err;
// if this language is set to 'submittable', it's an error
if ($row['allow_submit'] == 1) {
$langseverity = 'E';
} else {
$details .= ' (but is not submittable)';
}
$details .= "\n";
}
}
}
result('problems, languages, teams', 'Languages integrity', $details == '' ? 'O' : $langseverity, $details);
$details = '';
示例6: define
* tUsername
*
* Form POST \ GET Variables:
*
* fUsername
* fPassword
* lang
*/
$rel_path = '../';
define('POSTFIXADMIN_LOGOUT', 1);
require_once "../common.php";
if ($_SERVER['REQUEST_METHOD'] == "POST") {
$lang = safepost('lang');
$fUsername = trim(safepost('fUsername'));
$fPassword = safepost('fPassword');
if ($lang != check_language(0)) {
# only set cookie if language selection was changed
setcookie('lang', $lang, time() + 60 * 60 * 24 * 30);
# language cookie, lifetime 30 days
# (language preference cookie is processed even if username and/or password are invalid)
}
$h = new MailboxHandler();
if ($h->login($fUsername, $fPassword)) {
session_regenerate_id();
$_SESSION['sessid'] = array();
$_SESSION['sessid']['roles'] = array();
$_SESSION['sessid']['roles'][] = 'user';
$_SESSION['sessid']['username'] = $fUsername;
$_SESSION['PFA_token'] = md5(uniqid(rand(), true));
header("Location: main.php");
exit;
示例7: session_set_cookie_params
* @package MeteoLive
* @copyright Copyright (c) 2011-2012 NETFLIE. (http://meteolive.netflie.es)
* @license http://www.gnu.org/licenses/ GNU GPLv3
* @author Alejandro Albarca Martinez
*/
if (!defined('IN_WEB')) {
exit;
}
//Session options
session_set_cookie_params(3600 * 24 * 365);
// Require files
require_once 'config.php';
require_once 'functions.php';
//Define dir separator
define('DIR_SEPARATOR', '/');
// Define path to application directory
defined('MAIN_PATH') || define('MAIN_PATH', realpath(dirname(__FILE__)));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(realpath(MAIN_PATH . '/includes'), get_include_path())));
// Autoload function
function autoload($className)
{
require_once $className . '.php';
}
spl_autoload_register('autoload');
// Set default language as LANG constant value. Automatic language search is activated.
$translate = new Translate(array('locale' => LANG));
check_language($translate);
// Check if a GET language request exists.
// Preformatted units
preformatedd_units();
示例8: require_login
// $Id: spellchecker.php,v 1.9.2.1 2007/04/15 17:03:11 skodak Exp $
include_once "../../../config.php";
require_login();
if (empty($CFG->aspellpath)) {
error('Spellchecker not configured');
}
header('Content-type: text/html; charset=utf-8');
// Speller pages script http://spellerpages.sourceforge.net/
// Modified by Marc Alier on August 2004 for the integration with moodle
$aspell_prog = escapeshellarg($CFG->aspellpath);
$spellercss = $CFG->wwwroot . '/lib/speller/spellerStyle.css';
$word_win_src = $CFG->wwwroot . '/lib/speller/wordWindow.js';
$textinputs = $_POST['textinputs'];
// array
if (!($lang = check_language($aspell_prog))) {
error_handler("No suitable dictionary found installed on your server!");
exit;
}
$aspell_opts = '-a -H --lang=' . $lang . ' --encoding=utf-8';
if (!empty($CFG->aspellextradicts)) {
// eg /usr/bin/.aspell.en.pws
$aspell_opts .= ' --add-extra-dicts=' . $CFG->aspellextradicts;
}
$tempfiledir = $CFG->dataroot;
// Use dataroot since it must be writable
$input_separator = 'A';
function check_language($cmd)
{
/// return users current language if its
/// dictionary is found installed in system
示例9: die
die("config.inc.php is missing!");
}
require_once "{$incpath}/config.inc.php";
if (isset($CONF['configured'])) {
if ($CONF['configured'] == FALSE) {
die("Please edit config.inc.php - change \$CONF['configured'] to true after setting your database settings");
}
}
Config::write($CONF);
require_once "{$incpath}/languages/language.php";
require_once "{$incpath}/functions.inc.php";
if (defined('POSTFIXADMIN_CLI')) {
$language = 'en';
# TODO: make configurable or autodetect from locale settings
} else {
$language = check_language();
# TODO: storing the language only at login instead of calling check_language() on every page would save some processor cycles ;-)
$_SESSION['lang'] = $language;
}
require_once "{$incpath}/languages/" . $language . ".lang";
if (!empty($CONF['language_hook']) && function_exists($CONF['language_hook'])) {
$hook_func = $CONF['language_hook'];
$PALANG = $hook_func($PALANG, $language);
}
Config::write('__LANG', $PALANG);
if (!defined('POSTFIXADMIN_CLI')) {
if (!is_file("{$incpath}/smarty.inc.php")) {
die("smarty.inc.php is missing! Something is wrong...");
}
require_once "{$incpath}/smarty.inc.php";
}
示例10: array
}
if ($adminpass != $adminpass2) {
$content = "<p>" . _INSTALL_L48 . "</p>\n";
$b_back = array('', _INSTALL_L112);
include 'install_tpl.php';
exit;
}
error_reporting(0);
include_once "../mainfile.php";
//include_once './include/createtables2.php';
include_once './makedata.php';
include_once './class/dbmanager.php';
$dbm = new db_manager();
include_once './class/cachemanager.php';
$cm = new cache_manager();
$xoopsConfig['language'] = check_language($xoopsConfig['language']);
if (file_exists("./language/" . $xoopsConfig['language'] . "/install2.php")) {
include_once "./language/" . $xoopsConfig['language'] . "/install2.php";
} elseif (file_exists("./language/english/install2.php")) {
include_once "./language/english/install2.php";
$xoopsConfig['language'] = 'english';
} else {
echo 'no language file (install2.php).';
exit;
}
if (file_exists(XOOPS_ROOT_PATH . "/language/" . $xoopsConfig['language'] . "/global.php")) {
include_once XOOPS_ROOT_PATH . "/language/" . $xoopsConfig['language'] . "/global.php";
} else {
include_once XOOPS_ROOT_PATH . "/language/english/global.php";
}
if (file_exists("../modules/system/language/" . $xoopsConfig['language'] . "/admin/modulesadmin.php")) {
示例11: array
# this config block lists the regexps to run against strings in language files
#
# we can use this to check that translated versions have the required magic
# characters, such as the ^^linked word^^ syntax.
#
$rx_hats = '!\\^\\^(.*?)\\^\\^!';
$check = array('installer.properties' => array('title.version' => '!\\${VERSION}!', 'title.version.inst' => '!\\${VERSION}!'), 'main.dtd' => array('help.offline' => $rx_hats, 'help.drag' => $rx_hats, 'help.faq' => $rx_hats, '!photos.init.text.joined' => '!.+!'), 'main.properties' => array('video.add.restricted.sz.guidelines' => $rx_hats, 'video.add.restricted.pz.guidelines' => $rx_hats, 'video.add.restricted.sp.guidelines' => $rx_hats, 'video.add.restricted.pp.guidelines' => $rx_hats, 'video.edit.restricted.sz.guidelines' => $rx_hats, 'video.edit.restricted.pz.guidelines' => $rx_hats, 'video.edit.restricted.sp.guidelines' => $rx_hats, 'video.edit.restricted.pp.guidelines' => $rx_hats), 'proxy.dtd' => array('connectionDesc.label' => '!\\&brandShortName\\;!'));
#
# ignore everything below this line :)
#
#########################################################################################
$locales = dirname(__FILE__) . '/MacUploadr.app/Contents/Resources/chrome/locale';
$dh = opendir($locales);
while ($file = readdir($dh)) {
if (is_dir("{$locales}/{$file}") && preg_match('!^[a-z0-9]{2}-[a-z0-9]{2}$!i', $file)) {
check_language($file, $check);
}
}
closedir($dh);
#########################################################################################
function check_language($lang, $check)
{
echo "checking {$lang}: ";
flush();
foreach ($check as $file => $strings) {
$catalogue = load_strings($lang, $file);
foreach ($strings as $key => $rx) {
if ($key[0] == '!') {
if (preg_match($rx, $catalogue[substr($key, 1)])) {
echo "\nMatched {$rx} against {$catalogue[$key]}\n";
} else {
示例12: check_language
<?php
#set base_path to avoid path problems when including file
$base_path = !$is_home ? '../' : './';
$function_path = $base_path . 'Functions/functions.php';
include $function_path;
$data = check_language()->{$title};
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>
<?php
echo isset($title) ? $title : $default;
?>
</title>
<link rel="stylesheet" href="<?php
echo $base_path;
?>
Styles/Menu.css"/>
<link rel="stylesheet" href="<?php
echo $base_path;
?>
Styles/Assignments.css"/>
示例13: language_selector
function language_selector()
{
global $supported_languages;
# from languages/languages.php
$current_lang = check_language();
$selector = '<select name="lang" xml:lang="en" dir="ltr">';
foreach ($supported_languages as $lang => $lang_name) {
if ($lang == $current_lang) {
$selected = ' selected="selected"';
} else {
$selected = '';
}
$selector .= "<option value='{$lang}'{$selected}>{$lang_name}</option>";
}
$selector .= "</select>";
return $selector;
}
示例14: create
function create($kat, $title, $description, $pass_language_check = false)
{
global $sess, $auth, $glob_language_name, $glob_language;
if (!defined("SPELLING_INC")) {
include "commonapi/spelling.inc";
}
if (!strstr($kat, '/')) {
$kat = base64_decode($kat);
}
$predef['kat'] = $kat;
$predef['title'] = $title;
$predef['description'] = $description;
$title = str_replace(' ', '_', $title);
$exists = get_node_info($kat . $title);
$exists = $exists != -1;
if (strstr($title, '/')) {
$errfile = "err_invalidslash.html";
addform($predef, $errfile);
exit;
} elseif ($title == "") {
$errfile = "err_notitle.html";
addform($predef, $errfile);
exit;
} elseif ($description == "") {
$errfile = "err_nodesc.html";
addform($predef, $errfile);
exit;
} elseif ($exists) {
$errfile = "err_object_exists.html";
addform($predef, $errfile);
exit;
} elseif (!check_language($description, $glob_language_name) and !$pass_language_check) {
lang_query($kat, $title, $description);
} else {
$title = str_replace(' ', '_', $title);
$obj['name'] = $kat . $title;
$obj['parent'] = path2id($kat);
$obj['level'] = level_count($kat);
$obj['objecttype'] = "trail";
$obj['description'] = $description;
$obj['useraccess'] = 4;
$obj['friendaccess'] = 12;
$obj['owner'] = $auth->auth["uid"];
$obj['language'] = $glob_language;
add_object($obj, true);
Header("Location: " . $sess->url(build_good_url($obj['name']) . "?reloadparent=1"));
exit;
// echo("Debug: dieses Fenster schliessen");
}
}