本文整理汇总了PHP中language函数的典型用法代码示例。如果您正苦于以下问题:PHP language函数的具体用法?PHP language怎么用?PHP language使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了language函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor.
*
* @param \Cake\Network\Request $request Request object for this controller.
* Can be null for testing, but expect that features that use the request
* parameters will not work.
* @param \Cake\Network\Response $response Response object for this controller.
*/
public function __construct($request = null, $response = null)
{
parent::__construct($request, $response);
$location = $this->response->location();
$this->viewBuilder()->className('CMS\\View\\View');
if (empty($location)) {
$this->viewMode('default');
$this->prepareTheme();
$this->checkMaintenanceMode();
}
$this->response->header('Content-Language', language('code'));
$this->response->header('X-Generator', sprintf('QuickAppsCMS %s (http://quickappscms.org)', quickapps('version')));
}
示例2: current_password_check
function current_password_check($str = NULL)
{
if (!$this->CI->simpleloginsecure->verify_current_password($this->CI->session->userdata('user_id'), $str)) {
$this->set_message('current_password_check', language('current_password_check_error'));
return FALSE;
}
return TRUE;
}
示例3: task_condition
function task_condition()
{
global $discuz_uid;
include_once DISCUZ_ROOT . './uc_client/client.php';
include language('tasks');
if (uc_check_avatar($discuz_uid)) {
showmessage($tasklang['avatar_apply_var_desc_noavatar']);
}
}
示例4: l
function l($input, $lang = false)
{
if (!is_array($input)) {
return l(array_combine(array_slice(array_keys(languages()), 0, func_num_args()), func_get_args()));
}
if (!$lang) {
$lang = language();
}
return isset($input[$lang]) ? $input[$lang] : current($input);
}
示例5: get_slugs
public function get_slugs($field, $data, $object)
{
if (isset($data->id)) {
$slugs = array();
$object_language = language();
$parent_id = 0;
foreach ($object->children() as $sibling) {
if ($sibling->getName() == 'slug') {
$source = false;
foreach ($object->children() as $child) {
if (strval($child['name']) == strval($sibling['source'])) {
$source = $child;
}
}
if ($source) {
$name = isset($sibling['name']) ? strval($sibling['name']) : 'slug';
if (isset($source['translatable']) && $source['translatable']) {
foreach (languages() as $code => $lang) {
$fieldname = $name . '_' . $code;
$slugs[$code] = $data->{$fieldname};
}
} else {
$slugs[] = $data->{$name};
}
}
} else {
if ($sibling->getName() == 'language') {
$language = strval($sibling['name']);
$object_language = $data->{$language};
} else {
if ($sibling->getName() == 'recursive' && isset($data->parent_id) && $data->parent_id) {
$parent_id = $data->parent_id;
}
}
}
}
foreach ($slugs as $language => $slug) {
if (!is_string($language)) {
$slugs[$object_language] = $slug;
unset($slugs[$language]);
}
}
if ($parent_id) {
$parent_slugs = self::get_slugs($field, where('id = %d', $parent_id)->get_row($object['stack']), $object);
foreach ($parent_slugs as $key => $parent_slug) {
if (isset($slugs[$key])) {
$slugs[$key] = $parent_slug . '/' . $slugs[$key];
}
}
}
return $slugs;
} else {
return array();
}
}
示例6: init
function init()
{
parent::init();
language();
hook('controller');
/*
* load modules
* 加载模块
*/
if (!cache_pre('all_modules')) {
\app\core\Modules::load();
}
}
示例7: language
function language($file, $templateid = 0, $tpldir = '')
{
$tpldir = $tpldir ? $tpldir : TPLDIR;
$templateid = $templateid ? $templateid : TEMPLATEID;
$languagepack = GAME_ROOT . './' . $tpldir . '/' . $file . '.lang.php';
if (file_exists($languagepack)) {
return $languagepack;
} elseif ($templateid != 1 && $tpldir != './templates/default') {
return language($file, 1, './templates/default');
} else {
return FALSE;
}
}
示例8: Module
function Module()
{
global $_mid, $_tpl;
$_module = _fetch_list(_query('select module_tpl,module_det,module_name from tg_module where mid=' . $_mid));
$_tpl->assign('module_name', $_module['module_name']);
$_tpl->assign('module_en_name', language($_module['module_name']));
if ($_module['module_det']) {
if (isset($_GET['d']) && is_numeric($_GET['d'])) {
$_tpl->display($_module['module_det']);
return;
}
}
$_tpl->display($_module['module_tpl']);
}
示例9: init
function init()
{
parent::init();
language('language_');
if (\Yii::$app->user->isGuest) {
flash('error', __('login first'));
redirect(url('auth/open/login'));
}
/*
* load modules
* 加载模块
*/
if (!cache_pre('all_modules')) {
\app\core\Modules::load();
}
}
示例10: menu_active_block
function menu_active_block($url, $name, $language)
{
if ($name == 'dates') {
if ($_SERVER['SCRIPT_NAME'] == LOCATION . $url) {
return '<div class="menu_item active" style="width:190px;"><a href="' . $url . '">' . language($language, $name, 'Menu') . '</a></div>';
} else {
return '<div class="menu_item" style="width:190px;"><a href="' . $url . '">' . language($language, $name, 'Menu') . '</a></div>';
}
} else {
if ($_SERVER['SCRIPT_NAME'] == LOCATION . $url) {
return '<div class="menu_item active"><a href="' . $url . '">' . language($language, $name, 'Menu') . '</a></div>';
} else {
return '<div class="menu_item"><a href="' . $url . '">' . language($language, $name, 'Menu') . '</a></div>';
}
}
}
示例11: parse_template
function parse_template($file, $templateid, $tpldir)
{
global $language;
$nest = 5;
$tplfile = DISCUZ_ROOT . "./{$tpldir}/{$file}.htm";
$objfile = DISCUZ_ROOT . "./forumdata/templates/{$templateid}_{$file}.tpl.php";
if (!@($fp = fopen($tplfile, 'r'))) {
dexit("Current template file './{$tpldir}/{$file}.htm' not found or have no access!");
} elseif ($language['discuz_lang'] != 'templates' && !(include language('templates', $templateid, $tpldir))) {
dexit("<br />Current template pack do not have a necessary language file 'templates.lang.php' or have syntax error!");
}
$template = @fread($fp, filesize($tplfile));
fclose($fp);
$var_regexp = "((\\\$[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*)(\\[[a-zA-Z0-9_\\-\\.\"\\'\\[\\]\$-ÿ]+\\])*)";
$const_regexp = "([a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*)";
//$template = preg_replace("/([\n\r]+)\t+/s", "\\1", $template);
$template = preg_replace("/\\<\\!\\-\\-\\{(.+?)\\}\\-\\-\\>/s", "{\\1}", $template);
$template = preg_replace("/\\{lang\\s+(.+?)\\}/ies", "languagevar('\\1')", $template);
$template = preg_replace("/\\{faq\\s+(.+?)\\}/ies", "faqvar('\\1')", $template);
$template = str_replace("{LF}", "<?=\"\\n\"?>", $template);
$template = preg_replace("/\\{(\\\$[a-zA-Z0-9_\\[\\]\\'\"\$\\.-ÿ]+)\\}/s", "<?=\\1?>", $template);
$template = preg_replace("/{$var_regexp}/es", "addquote('<?=\\1?>')", $template);
$template = preg_replace("/\\<\\?\\=\\<\\?\\={$var_regexp}\\?\\>\\?\\>/es", "addquote('<?=\\1?>')", $template);
$template = "<? if(!defined('IN_DISCUZ')) exit('Access Denied'); ?>\n{$template}";
$template = preg_replace("/[\n\r\t]*\\{template\\s+([a-z0-9_]+)\\}[\n\r\t]*/is", "\n<? include template('\\1'); ?>\n", $template);
$template = preg_replace("/[\n\r\t]*\\{template\\s+(.+?)\\}[\n\r\t]*/is", "\n<? include template(\\1); ?>\n", $template);
$template = preg_replace("/[\n\r\t]*\\{eval\\s+(.+?)\\}[\n\r\t]*/ies", "stripvtags('<? \\1 ?>','')", $template);
$template = preg_replace("/[\n\r\t]*\\{echo\\s+(.+?)\\}[\n\r\t]*/ies", "stripvtags('<? echo \\1; ?>','')", $template);
$template = preg_replace("/([\n\r\t]*)\\{elseif\\s+(.+?)\\}([\n\r\t]*)/ies", "stripvtags('\\1<? } elseif(\\2) { ?>\\3','')", $template);
$template = preg_replace("/([\n\r\t]*)\\{else\\}([\n\r\t]*)/is", "\\1<? } else { ?>\\2", $template);
for ($i = 0; $i < $nest; $i++) {
$template = preg_replace("/[\n\r\t]*\\{loop\\s+(\\S+)\\s+(\\S+)\\}[\n\r]*(.+?)[\n\r]*\\{\\/loop\\}[\n\r\t]*/ies", "stripvtags('<? if(is_array(\\1)) { foreach(\\1 as \\2) { ?>','\\3<? } } ?>')", $template);
$template = preg_replace("/[\n\r\t]*\\{loop\\s+(\\S+)\\s+(\\S+)\\s+(\\S+)\\}[\n\r\t]*(.+?)[\n\r\t]*\\{\\/loop\\}[\n\r\t]*/ies", "stripvtags('<? if(is_array(\\1)) { foreach(\\1 as \\2 => \\3) { ?>','\\4<? } } ?>')", $template);
$template = preg_replace("/([\n\r\t]*)\\{if\\s+(.+?)\\}([\n\r]*)(.+?)([\n\r]*)\\{\\/if\\}([\n\r\t]*)/ies", "stripvtags('\\1<? if(\\2) { ?>\\3','\\4\\5<? } ?>\\6')", $template);
}
$template = preg_replace("/\\{{$const_regexp}\\}/s", "<?=\\1?>", $template);
$template = preg_replace("/ \\?\\>[\n\r]*\\<\\? /s", " ", $template);
if (!@($fp = fopen($objfile, 'w'))) {
dexit("Directory './forumdata/templates/' not found or have no access!");
}
$template = preg_replace("/\"(http)?[\\w\\.\\/:]+\\?[^\"]+?&[^\"]+?\"/e", "transamp('\\0')", $template);
$template = preg_replace("/\\<script[^\\>]*?src=\"(.+?)\".*?\\>\\s*\\<\\/script\\>/ise", "stripscriptamp('\\1')", $template);
$template = preg_replace("/[\n\r\t]*\\{block\\s+([a-zA-Z0-9_]+)\\}(.+?)\\{\\/block\\}/ies", "stripblock('\\1', '\\2')", $template);
flock($fp, 2);
fwrite($fp, $template);
fclose($fp);
}
示例12: sendpm
}
if ($type == 0) {
$ratestatus = $order['ratestatus'] == 2 ? 3 : 1;
} else {
$ratestatus = $order['ratestatus'] == 1 ? 3 : 2;
}
$db->query("UPDATE {$tablepre}tradelog SET ratestatus='{$ratestatus}' WHERE orderid='{$order['orderid']}'");
if ($ratestatus != 3) {
sendpm($order[$rateeid], 'eccredit_subject', 'eccredit_message', '0', 'System Message');
}
showmessage('eccredit_succees');
}
} elseif ($action == 'explain' && $id) {
$id = intval($id);
if (!submitcheck('explainsubmit', 1)) {
include template('ec_explain');
} else {
$comment = $db->fetch_first("SELECT explanation, dateline FROM {$tablepre}tradecomments WHERE id='{$id}' AND rateeid='{$discuz_uid}'");
if (!$comment) {
showmessage('eccredit_nofound');
} elseif ($comment['explanation']) {
showmessage('eccredit_reexplanation_repeat');
} elseif ($comment['dateline'] < $timestamp - 30 * 86400) {
showmessage('eccredit_reexplanation_closed');
}
$explanation = cutstr(dhtmlspecialchars($explanation), 200);
$db->query("UPDATE {$tablepre}tradecomments SET explanation='{$explanation}' WHERE id='{$id}'");
include_once language('misc');
showmessage("<script type=\"text/javascript\">\$('ecce_{$id}').innerHTML = '<font class=\"lighttxt\">{$language['eccredit_explain']}: " . addslashes($explanation) . "</font>';hideMenu();</script>");
}
}
示例13: show_message
function show_message($show_message, $url_forward = '')
{
global $charset, $site_name, $cyask_user, $url, $tpldir, $styleid, $styledir, $syninfo;
$extrahead = $url_forward ? '<meta http-equiv="refresh" content="3 url=' . $url_forward . '">' : '';
include language('messages', $tpldir, $styleid);
$show_message = $lang[$show_message] ? $lang[$show_message] : $lang['undefined_action'];
include template('show_message', 'messages');
exit;
}
示例14: language
<div class="tab-content">' . $list . '
</div>';
}
?>
</div>
<input id="adms" type="hidden" value="n">
<input id="elements" type="hidden" value="href,module">
<input id="add_to_lng" type="hidden" value="<?php
echo $lt;
?>
">
<input id="rows" type="hidden" value="link,submenu,title_lang">
<input id="classes" type="hidden" value="">
<input id="icon" type="hidden" value="fa-chevron-top">
<input type="hidden" value="<?php
echo language('href', $lang) . ',' . language('modules', $lang) . $ltt . ',' . language('not found', $lang) . ',' . language('adding left', $lang) . ',' . language('left added', $lang) . ',' . language('error added', $lang);
?>
" id="tts">
<div style="text-align:center;margin-top:20px;"><button class="btn-success btn" onclick=main('menu','add')><?php
echo language('add', $lang);
?>
</button></div>
<div id="loading" style="text-align:center;display:none;margin:30px;"><img src="<?php
echo $admin_page;
?>
assets/img/load.gif"></div>
</div>
</div>
示例15: language
language("Danish", array(site("http://boincdenmark.dk", "BOINC@Denmark"), site("http://www.setihome.dk", "www.setihome.dk")));
language("Dutch", array(site("http://www.dutchpowercows.org/", "Dutch Power Cows\n </a>(also <a href=http://gathering.tweakers.net/forum/list_topics/5>forums</a>)"), site("http://www.seti.nl/content.php?c=boincmain", "SETI@Netherlands"), site("http://www.boinc.be", "www.boinc.be")));
language("English", array(site("http://www.overclock.net/f/365/overclock-net-boinc-team", "Overclock.net"), site("http://z15.invisionfree.com/The_Boinc_Bar/index.php?act=idx", "The BOINC Bar"), site("http://www.s15.invisionfree.com/Crunchers_Inc/index.php?act=idx", "Crunchers Inc."), site("http://www.calmchaosonline.com/", "Calm Chaos"), site("http://www.teamphoenixrising.net/", "Team Phoenix Rising"), site("http://www.unitedmacs.com/", "United Macs"), site("http://www.ukboincteam.org.uk/", "UK BOINC Team"), site("http://www.bc-team.org/", "BOINC Confederation"), site("http://www.free-dc.org/", "Free-DC"), site("http://forums.anandtech.com/categories.aspx?catid=39&entercat=y", "TeAm Anandtech"), site("http://www.boinc-australia.net", "BOINC@Australia"), site("http://www.boincuk.com/", "BOINC UK and Team Lookers"), site("http://www.boincsynergy.com/", "BOINC Synergy"), site("http://www.tswb.org", "Team Starfire World BOINC")));
//language("Estonian", array(
//site("http://boinc.tmac.pri.ee", "boinc.tmac.pri.ee"),
//site("http://setimehed.net/", "setimehed.net"),
//));
language("Finnish", array(site("http://www.universe-examiners.org/", "Universe Examiners")));
language("French", array(site("http://boinc.starwars-holonet.com/", "Star Wars [FR]"), site("http://www.boinc-af.org", "L'Alliance Francophone")));
language("German", array(site("http://www.crunchers-freiburg.de/", "crunchers@freiburg"), site("http://www.unitedmacs.com/", "United Macs"), site("http://www.rechenkraft.net/", "Rechenkraft"), site("http://www.seti-leipzig.de/", "SETI-Leipzig"), site("http://www.dc-gemeinschaft.com/", "DC - Gemeinschaft"), site("http://boinccast.podhost.de/", "BOINCcast (Podcast)"), site("http://www.boinc-team.de/", "BOINC@Heidelberg"), site("http://www.boinc.at/", "www.boinc.at"), site("http://www.boinc-halle-saale.de", "BOINC@Halle/Saale"), site("http://www.bc-team.org/", "BOINC Confederation"), site("http://www.seti-germany.de", "SETI.Germany"), site("http://www.sar-hessen.org", "Team Science and Research Hessen"), site("http://www.boinc.de/", "www.boinc.de")));
//language("Hungarian", array(
//site("http://seti.hwsw.hu/", "HWSW SETI@home Team")
//));
language("Italian", array(site("http://www.calcolodistribuito.it/", "Calcolo Distribuito"), site("http://www.boincitaly.org/", "BOINC.Italy"), site("http://gaming.ngi.it/forum/forumdisplay.php?f=73", "NGI forum"), site("http://it.groups.yahoo.com/group/BOINC-ITALIA/", "BOINC-ITALIA")));
language("Japanese", array(site("http://boinc.oocp.org/", "translation by Komori Hitoshi")));
language("Korean", array(site("http://cafe.naver.com/setikah", "SETIKAH@KOREA")));
language("Polish", array(site("http://www.boincatpoland.org", "BOINC@Poland"), site("http://boinc.pl", "BOINC Polish National Team"), site("http://www.tomaszpawel.republika.pl/", "TomaszPawelTeam")));
language("Portuguese", array(site("http://www.setibr.org/", "SETIBR")));
//language("Romanian", array(
// site( "http://www.boinc.ro/", "SETI@home Romania")
//));
language("Russian", array(site("http://vkontakte.ru/club11963359", "BOINC group on vkontakte.ru"), site("http://www.boinc.ru", "BOINC.ru"), site("http://distributed.ru", "distributed.ru")));
language("Slovak", array(site("http://www.boinc.sk/", "www.boinc.sk")));
language("Spanish", array(site("http://www.titanesdc.com/", "Foros TitanesDC"), site("http://www.seti.cl/", "BOINC SETI Chile"), site("http://www.easyboinc.org/", "Computación Distribuida"), site("http://foro.noticias3d.com/vbulletin/showthread.php?t=192297", "Noticias3D"), site("http://www.boinc-ecuador.com/", "BOINC - Ecuador"), site("http://www.hispaseti.org/", "HispaSeti")));
//language("Turkish", array(
//site("http://www.turksetiteam.org/", "www.turksetiteam.org"),
//site("http://www.boinctr.com/", "www.boinctr.com")
//));
language("Ukrainian", array(site("http://distributed.org.ua/", "Ukraine - Distributed Computing")));
echo "\n</table>\n<p>\nIf you'd like to add a web site to this list, please\n<a href=mailto:davea@ssl.berkeley.edu>contact us</a>.\n\n<a name=video>\n<h2>BOINC-related videos</h2>\n\n<ul>\n<li> <a href=http://www.youtube.com/watch?v=8iSRLIK-x6A>David Anderson talks about BOINC</a> (2006)\n<li> <a href=http://www.youtube.com/watch?v=GzATbET3g54>David Baker talks about Rosetta@home</a>\n</ul>\n";
page_tail();