本文整理汇总了PHP中Lang::item方法的典型用法代码示例。如果您正苦于以下问题:PHP Lang::item方法的具体用法?PHP Lang::item怎么用?PHP Lang::item使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lang
的用法示例。
在下文中一共展示了Lang::item方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
function render($template, $vars = array(), $debug = FALSE)
{
if ($debug) {
echo '<pre>';
var_dump($vars);
echo '</pre>';
}
if (is_array($vars) && count($vars) > 0) {
$this->setVars($vars);
}
$viewPath = $this->getViewPath($template);
if (!file_exists($viewPath)) {
cpg_die(ERROR, sprintf(Lang::item('error.missing_vw_file'), $viewPath), __FILE__, __LINE__);
}
extract($this->vars);
// checking model
$authorizer = check_model::getInstance();
ob_start();
include_once $viewPath;
$fr_contents = ob_get_contents();
ob_end_clean();
if (empty($fr_title) || !$fr_title) {
$fr_title = $vars[nagavitor][0][1] . " - " . Config::item('fr_title');
}
include_once $this->getMainPath();
}
示例2: renderTooltip
public function renderTooltip()
{
if (!$this->curTpl) {
return array();
}
$x = '<table><tr><td>';
$x .= '<span class="q' . $this->getField('quality') . '">' . Util::jsEscape($this->getField('name', true)) . '</span><br />';
$nClasses = 0;
if ($_ = $this->getField('classMask')) {
$cl = Lang::getClassString($_, $__, $nClasses);
$x .= Util::ucFirst($nClasses > 1 ? Lang::game('classes') : Lang::game('class')) . Lang::main('colon') . $cl . '<br />';
}
if ($_ = $this->getField('contentGroup')) {
$x .= Util::jsEscape(Lang::itemset('notes', $_)) . ($this->getField('heroic') ? ' <i class="q2">(' . Lang::item('heroic') . ')</i>' : '') . '<br />';
}
if (!$nClasses || !$this->getField('contentGroup')) {
$x .= Lang::itemset('types', $this->getField('type')) . '<br />';
}
if ($bonuses = $this->getBonuses()) {
$x .= '<span>';
foreach ($bonuses as $b) {
$x .= '<br /><span class=\\"q13\\">' . $b['bonus'] . ' ' . Lang::itemset('_pieces') . Lang::main('colon') . '</span>' . Util::jsEscape($b['desc']);
}
$x .= '</span>';
}
$x .= '</td></tr></table>';
return $x;
}
示例3: yesno
function yesno($name, $value = '')
{
// 1||0//Y||N//y||n//YES||NO - autodetect
$html = "";
switch ($value) {
case '0':
case '1':
$values = array(1, 0);
break;
case 'Y':
case 'N':
$values = array('Y', 'N');
case 'y':
case 'n':
$values = array('y', 'n');
case 'YES':
case 'NO':
$values = array('YES', 'NO');
default:
$values = array('YES', 'NO');
}
$html .= form::radio($name, $values[0], Lang::item('common.yes'), $value);
$html .= form::radio($name, $values[1], Lang::item('common.no'), $value);
return $html;
}
示例4: message
function message($title, $message, $link, $time = 2)
{
global $CONFIG;
if ($CONFIG['display_redirection_page'] == 0) {
header("Location: {$link}&message_id=" . cpgStoreTempMessage($message));
} else {
pageheader($title, "<META http-equiv=\"refresh\" content=\"{$time};url={$link}\">");
msg_box($title, $message, Lang::item('common.continue'), $link);
pagefooter();
}
exit;
}
示例5: index
function index()
{
$vars = array();
$authorizer = check_model::getInstance();
$vars['nagavitor'] = $this->forum->get_nagavitor();
$vars['cat_id'] = $this->validate->get->getInt('id');
if ($vars['cat_id']) {
if (!$authorizer->is_cat_id($vars['cat_id'])) {
cpg_die(ERROR, Lang::item('error.wrong_cat_id'), __FILE__, __LINE__);
}
}
$vars['user_posts'] = $this->forum->get_user_post_count();
$vars['last_visit'] = $this->forum->get_last_visit_time();
$cats = $this->forum->get_category($vars['cat_id'], 'cat_id, name');
$vars['categories'] = array();
foreach ($cats as $cat) {
$newcat = array();
$newcat['name'] = $cat['name'];
$newcat['id'] = $cat['cat_id'];
$boards = $this->forum->get_first_level_board($cat['cat_id'], 'board_id,name,description,last_msg_id,topics,posts,child_level');
$newcat['boards'] = array();
foreach ($boards as $board) {
$last_message = $this->forum->get_message_data($board['last_msg_id'], 'subject, poster_id, poster_time');
$newboard = array();
$newboard['icon'] = 'plugins/forum/forum/html/images/icon_board_new.gif';
$newboard['id'] = $board['board_id'];
$newboard['name'] = $board['name'];
$newboard['description'] = $board['description'];
$newboard['last_post_id'] = $board['last_msg_id'];
$newboard['last_post_title'] = $last_message['subject'];
$newboard['last_post_time'] = $last_message['poster_time'];
$newboard['last_post_author_id'] = $last_message['poster_id'];
$newboard['last_post_author_name'] = get_username($last_message['poster_id']);
$newboard['topics'] = $board['topics'];
$newboard['replies'] = $board['posts'];
$newboard['childs'] = $this->forum->get_child_board($board['board_id'], $board['child_level'], 'board_id, name');
$newcat['boards'][] = $newboard;
unset($newboard);
}
$vars['categories'][] = $newcat;
unset($newcat);
}
$recents = $this->forum->get_latest_message();
$vars['recents'] = $recents;
$vars['stats'] = $this->forum->get_statistics();
$vars['newest_members'] = $this->forum->get_latest_user();
$vars['active_members'] = $this->forum->get_active_user();
$this->view->render('home/index', $vars);
}
示例6: load_library
function load_library($library, $return = FALSE)
{
global $libraries;
$library = ucfirst(strtolower($library));
$library_file = BASE_DIR . 'plugins' . DS . 'forum' . DS . 'forum' . DS . 'libraries' . DS . $library . '.php';
if (file_exists($library_file)) {
if (!$libraries[$library]) {
include $library_file;
$libaries[$library] = TRUE;
}
$class_name = ucfirst(strtolower($library));
if ($return === TRUE) {
return new $class_name();
}
} else {
cpg_die(ERROR, sprintf(Lang::item('error.missing_li_file'), $library_file), __FILE__, __LINE__);
}
}
示例7: locked
function locked()
{
$authorizer = check_model::getInstance();
$topic_id = $this->validate->get->getInt('id');
if (!$authorizer->is_topic_id($topic_id)) {
cpg_die(ERROR, Lang::item('error.wrong_topic_id'), __FILE__, __LINE__);
}
if (!$authorizer->can_moderator_topic($topic_id)) {
cpg_die(ERROR, Lang::item('error.perm_denied'), __FILE__, __LINE__);
}
$this->forum->lock_topic($topic_id);
forum::redirect('forum.php?c=topic&id=' . $topic_id);
}
示例8: createExtraMenus
private function createExtraMenus()
{
$menu = array('type' => [[], null], 'slot' => [[], null]);
if (!$this->category) {
$menu['slot'] = [Lang::item('inventoryType'), null];
asort($menu['slot'][0]);
} else {
if (isset($this->category[2]) && is_array(Lang::item('cat', $this->category[0], 1, $this->category[1]))) {
$catList = Lang::item('cat', $this->category[0], 1, $this->category[1], 1, $this->category[2]);
} else {
if (isset($this->category[1]) && is_array(Lang::item('cat', $this->category[0]))) {
$catList = Lang::item('cat', $this->category[0], 1, $this->category[1]);
} else {
$catList = Lang::item('cat', $this->category[0]);
}
}
switch ($this->category[0]) {
case 0:
if (!isset($this->category[1])) {
$menu['type'] = [Lang::item('cat', 0, 1), null];
}
if (!isset($this->category[1]) || in_array($this->category[1], [6, -3])) {
$menu['slot'] = [Lang::item('inventoryType'), 0x63efea];
asort($menu['slot'][0]);
}
break;
case 2:
if (!isset($this->category[1])) {
$menu['type'] = [Lang::spell('weaponSubClass'), null];
}
$menu['slot'] = [Lang::item('inventoryType'), 0x262a000];
asort($menu['slot'][0]);
break;
case 4:
if (!isset($this->category[1])) {
$menu['slot'] = [Lang::item('inventoryType'), 0x10895ffe];
$menu['type'] = [Lang::item('cat', 4, 1), null];
} else {
if (in_array($this->category[1], [1, 2, 3, 4])) {
$menu['slot'] = [Lang::item('inventoryType'), 0x7ea];
}
}
asort($menu['slot'][0]);
break;
case 16:
if (!isset($this->category[2])) {
$this->sharedLV['visibleCols'][] = 'glyph';
}
case 1:
if ($this->category[0] == 1) {
$this->sharedLV['visibleCols'][] = 'slots';
}
case 3:
if (!isset($this->category[1])) {
asort($catList[1]);
}
case 7:
case 9:
$this->sharedLV['hiddenCols'][] = 'slot';
case 15:
if (!isset($this->category[1])) {
$menu['type'] = [$catList[1], null];
}
break;
}
}
return $menu;
}
示例9: echo
<td class="padded">
<select name="gm">
<option<?php
echo !isset($f['gm']) ? ' selected' : null;
?>
></option>
<option value="2"<?php
echo (isset($f['gm']) && $f['gm'] == 2 ? ' selected' : null) . '>' . Lang::item('quality', 2);
?>
</option>
<option value="3"<?php
echo (isset($f['gm']) && $f['gm'] == 3 ? ' selected' : null) . '>' . Lang::item('quality', 3);
?>
</option>
<option value="4"<?php
echo (isset($f['gm']) && $f['gm'] == 4 ? ' selected' : null) . '>' . Lang::item('quality', 4);
?>
</option>
</select>
<input type="checkbox" name="jc" value="1" id="jc" <?php
echo isset($f['jc']) && $f['jc'] == 1 ? 'checked="checked" ' : null;
?>
/><label for="jc"><?php
echo sprintf(Lang::main('jcGemsOnly'), ' class="tip" onmouseover="$WH.Tooltip.showAtCursor(event, LANG.tooltip_jconlygems, 0, 0, \'q\')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"');
?>
</label>
</td>
</tr>
</table>
<div id="fi_weight" class="criteria" style="display: none"><div></div></div>
示例10: Copyright
<?php
/**************************************************
Coppermine 1.5.x Plugin - forum
*************************************************
Copyright (c) 2010 foulu (Le Hoai Phuong), eenemeenemuu
*************************************************
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
********************************************
$HeadURL$
$Revision$
$LastChangedBy$
$Date$
**************************************************/
echo table::open();
echo table::title(Lang::item('board.topic_preview'), 1);
echo table::tds(array('class' => 'tableh2', 'text' => $subject));
echo table::tds(array('class' => 'tableb', 'text' => $message));
echo table::close();
示例11: Book
<?php
if (!empty($this->pageText)) {
?>
<div class="clear"></div>
<h3><?php
echo Lang::item('content');
?>
</h3>
<div id="book-generic"></div>
<script>//<![CDATA[
new Book({ parent: 'book-generic', pages: <?php
echo Util::toJSON($this->pageText);
?>
})
//]]></script>
<?php
}
示例12: createRequiredItems
private function createRequiredItems()
{
// parse itemClass & itemSubClassMask
$class = $this->subject->getField('equippedItemClass');
$subClass = $this->subject->getField('equippedItemSubClassMask');
$invType = $this->subject->getField('equippedItemInventoryTypeMask');
if ($class <= 0 || $subClass <= 0) {
return;
}
$title = ['Class: ' . $class, 'SubClass: ' . Util::asHex($subClass)];
$text = Lang::getRequiredItems($class, $subClass, false);
if ($invType) {
// remap some duplicated strings 'Off Hand' and 'Shield' are never used simultaneously
if ($invType & 1 << INVTYPE_ROBE) {
$invType &= ~(1 << INVTYPE_ROBE);
$invType &= 1 << INVTYPE_CHEST;
}
if ($invType & 1 << INVTYPE_RANGEDRIGHT) {
$invType &= ~(1 << INVTYPE_RANGEDRIGHT);
$invType &= 1 << INVTYPE_RANGED;
}
$_ = [];
$strs = Lang::item('inventoryType');
foreach ($strs as $k => $str) {
if ($invType & 1 << $k && $str) {
$_[] = $str;
}
}
$title[] = Lang::item('slot') . Lang::main('colon') . Util::asHex($invType);
$text .= ' ' . Lang::spell('_inSlot') . Lang::main('colon') . implode(', ', $_);
}
return [$title, $text];
}
示例13: generateContent
protected function generateContent()
{
$this->addJS('?data=zones&locale=' . User::$localeId . '&t=' . $_SESSION['dataKey']);
/***********/
/* Infobox */
/***********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// Event (ignore events, where the object only gets removed)
if ($_ = DB::World()->selectCol('SELECT DISTINCT IF(ge.holiday, ge.holiday, -ge.eventEntry) FROM game_event ge, game_event_gameobject geg, gameobject g WHERE ge.eventEntry = geg.eventEntry AND g.guid = geg.guid AND g.id = ?d', $this->typeId)) {
$this->extendGlobalIds(TYPE_WORLDEVENT, $_);
$ev = [];
foreach ($_ as $i => $e) {
$ev[] = ($i % 2 ? '[br]' : ' ') . '[event=' . $e . ']';
}
$infobox[] = Util::ucFirst(Lang::game('eventShort')) . Lang::main('colon') . implode(',', $ev);
}
// Reaction
$_ = function ($r) {
if ($r == 1) {
return 2;
}
if ($r == -1) {
return 10;
}
return;
};
$infobox[] = Lang::npc('react') . Lang::main('colon') . '[color=q' . $_($this->subject->getField('A')) . ']A[/color] [color=q' . $_($this->subject->getField('H')) . ']H[/color]';
// reqSkill
switch ($this->subject->getField('typeCat')) {
case -3:
// Herbalism
$infobox[] = sprintf(Lang::game('requires'), Lang::spell('lockType', 2) . ' (' . $this->subject->getField('reqSkill') . ')');
break;
case -4:
// Mining
$infobox[] = sprintf(Lang::game('requires'), Lang::spell('lockType', 3) . ' (' . $this->subject->getField('reqSkill') . ')');
break;
case -5:
// Lockpicking
$infobox[] = sprintf(Lang::game('requires'), Lang::spell('lockType', 1) . ' (' . $this->subject->getField('reqSkill') . ')');
break;
default:
$locks = Lang::getLocks($this->subject->getField('lockId'));
$l = '';
foreach ($locks as $idx => $_) {
if ($idx < 0) {
continue;
}
$this->extendGlobalIds(TYPE_ITEM, $idx);
$l = Lang::gameObject('key') . Lang::main('colon') . '[item=' . $idx . ']';
}
// if no propper item is found use a skill
if ($locks) {
$infobox[] = $l ? $l : array_pop($locks);
}
}
// linked trap
if ($_ = $this->subject->getField('linkedTrap')) {
$this->extendGlobalIds(TYPE_OBJECT, $_);
$infobox[] = Lang::gameObject('trap') . Lang::main('colon') . '[object=' . $_ . ']';
}
// trap for
$trigger = new GameObjectList(array(['linkedTrap', $this->typeId]));
if (!$trigger->error) {
$this->extendGlobalData($trigger->getJSGlobals());
$infobox[] = Lang::gameObject('triggeredBy') . Lang::main('colon') . '[object=' . $trigger->id . ']';
}
// SpellFocus
if ($_ = $this->subject->getField('spellFocusId')) {
if ($sfo = DB::Aowow()->selectRow('SELECT * FROM ?_spellfocusobject WHERE id = ?d', $_)) {
$infobox[] = '[tooltip name=focus]' . Lang::gameObject('focusDesc') . '[/tooltip][span class=tip tooltip=focus]' . Lang::gameObject('focus') . Lang::main('colon') . Util::localizedString($sfo, 'name') . '[/span]';
}
}
// lootinfo: [min, max, restock]
if (($_ = $this->subject->getField('lootStack')) && $_[0]) {
$buff = Lang::item('charges') . Lang::main('colon') . $_[0];
if ($_[0] < $_[1]) {
$buff .= Lang::game('valueDelim') . $_[1];
}
// since Veins don't have charges anymore, the timer is questionable
$infobox[] = $_[2] > 1 ? '[tooltip name=restock]' . sprintf(Lang::gameObject('restock'), Util::formatTime($_[2] * 1000)) . '[/tooltip][span class=tip tooltip=restock]' . $buff . '[/span]' : $buff;
}
// meeting stone [minLevel, maxLevel, zone]
if ($this->subject->getField('type') == OBJECT_MEETINGSTONE) {
if ($_ = $this->subject->getField('mStone')) {
$this->extendGlobalIds(TYPE_ZONE, $_[2]);
$m = Lang::game('meetingStone') . Lang::main('colon') . '[zone=' . $_[2] . ']';
$l = $_[0];
if ($_[0] > 1 && $_[1] > $_[0]) {
$l .= Lang::game('valueDelim') . min($_[1], MAX_LEVEL);
}
$infobox[] = $l ? '[tooltip name=meetingstone]' . sprintf(Lang::game('reqLevel'), $l) . '[/tooltip][span class=tip tooltip=meetingstone]' . $m . '[/span]' : $m;
}
}
// capture area [minPlayer, maxPlayer, minTime, maxTime, radius]
if ($this->subject->getField('type') == OBJECT_CAPTURE_POINT) {
if ($_ = $this->subject->getField('capture')) {
$buff = Lang::gameObject('capturePoint');
if ($_[2] > 1 || $_[0]) {
$buff .= Lang::main('colon') . '[ul]';
//.........这里部分代码省略.........
示例14: notFound
public function notFound()
{
if ($this->mode == CACHE_TYPE_TOOLTIP) {
header('Content-type: application/x-javascript; charset=utf-8');
echo $this->generateTooltip(true);
exit;
} else {
if ($this->mode == CACHE_TYPE_XML) {
header('Content-type: text/xml; charset=utf-8');
echo $this->generateXML(true);
exit;
} else {
return parent::notFound(Lang::game('item'), Lang::item('notFound'));
}
}
}
示例15: foreach
echo table::td(Lang::item('home.latest_posts'), 2);
foreach ($recents as $recent) {
echo table::tds(array(array('class' => 'tableb', 'text' => table::open(2) . table::tds(array(array('text' => sprintf(Lang::item('home.latest_post'), html::message_anchor($recent['msg_id'], $recent['subject']), html::profile_anchor($recent['poster_id'], $recent['poster_name']))), array('align' => 'right', 'text' => time::decode($recent['poster_time'])))) . table::close())));
}
echo table::close();
// left
$left_table = '';
$left_table .= table::open(3);
$left_table .= table::td(Lang::item('home.visitor_stats'), 4);
$left_table .= table::tds(array(array('class' => 'tableb', 'text' => Lang::item('home.t_r_m')), array('class' => 'tableb', 'text' => $stats['t_r_m']), array('class' => 'tableb', 'text' => Lang::item('home.t_li_u')), array('class' => 'tableb', 'text' => $stats['t_li_u'])));
$left_table .= table::tds(array(array('class' => 'tableb', 'text' => Lang::item('home.t_t')), array('class' => 'tableb', 'text' => $stats['t_t']), array('class' => 'tableb', 'text' => Lang::item('home.t_a_u')), array('class' => 'tableb', 'text' => $stats['t_a_u'])));
$left_table .= table::tds(array(array('class' => 'tableb', 'text' => Lang::item('home.t_r')), array('class' => 'tableb', 'text' => $stats['t_r']), array('class' => 'tableb', 'text' => ' '), array('class' => 'tableb', 'text' => ' ')));
$left_table .= table::close();
// right
foreach ($newest_members as $k => $v) {
$newest_members[$k] = html::profile_anchor($v['user_id'], $v['user_name']);
}
$newest_members = implode(', ', $newest_members);
foreach ($active_members as $k => $v) {
$active_members[$k] = html::profile_anchor($v['user_id'], $v['user_name']);
}
$active_members = implode(', ', $active_members);
$right_table = '';
$right_table .= table::open(3);
$right_table .= table::td(Lang::item('home.members'));
$right_table .= table::tds(array('class' => 'tableb', 'text' => Lang::item('home.newest_members') . $newest_members));
$right_table .= table::tds(array('class' => 'tableb', 'text' => Lang::item('home.active_members') . $active_members));
$right_table .= table::close();
echo table::open(array('align' => 'center', 'width' => -1, 'border' => 0, 'cellspacing' => 1, 'cellpadding' => 0));
echo table::tds(array(array('width' => '50%', 'valign' => 'top', 'text' => $left_table), array('width' => '50%', 'valign' => 'top', 'text' => $right_table)));
echo table::close();