本文整理汇总了PHP中Lang::itemset方法的典型用法代码示例。如果您正苦于以下问题:PHP Lang::itemset方法的具体用法?PHP Lang::itemset怎么用?PHP Lang::itemset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lang
的用法示例。
在下文中一共展示了Lang::itemset方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: notFound
public function notFound()
{
if ($this->mode != CACHE_TYPE_TOOLTIP) {
return parent::notFound(Lang::game('itemset'), Lang::itemset('notFound'));
}
header('Content-type: application/x-javascript; charset=utf-8');
echo $this->generateTooltip(true);
exit;
}
示例3: generateContent
protected function generateContent()
{
$_ta = $this->subject->getField('contentGroup');
$_ty = $this->subject->getField('type');
$_cnt = count($this->subject->getField('pieces'));
/***********/
/* Infobox */
/***********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// unavailable (todo (low): set data)
if ($this->subject->getField('cuFlags') & CUSTOM_UNAVAILABLE) {
$infobox[] = Lang::main('unavailable');
}
// holiday
if ($h = $this->subject->getField('holidayId')) {
$infobox[] = Lang::game('eventShort') . Lang::main('colon') . '[event=' . $h . ']';
$this->extendGlobalIds(TYPE_WORLDEVENT, $h);
}
// itemLevel
if ($min = $this->subject->getField('minLevel')) {
$foo = Lang::game('level') . Lang::main('colon') . $min;
$max = $this->subject->getField('maxLevel');
if ($min < $max) {
$foo .= ' - ' . $max;
}
$infobox[] = $foo;
}
// class
if ($cl = Lang::getClassString($this->subject->getField('classMask'), $jsg, $qty, false)) {
$this->extendGlobalIds(TYPE_CLASS, $jsg);
$t = $qty == 1 ? Lang::game('class') : Lang::game('classes');
$infobox[] = Util::ucFirst($t) . Lang::main('colon') . $cl;
}
// required level
if ($lvl = $this->subject->getField('reqLevel')) {
$infobox[] = sprintf(Lang::game('reqLevel'), $lvl);
}
// type
if ($_ty) {
$infobox[] = Lang::game('type') . Lang::main('colon') . Lang::itemset('types', $_ty);
}
// tag
if ($_ta) {
$infobox[] = Lang::itemset('_tag') . Lang::main('colon') . '[url=?itemsets&filter=ta=' . $_ta . ']' . Lang::itemset('notes', $_ta) . '[/url]';
}
/****************/
/* Main Content */
/****************/
// pieces + Summary
$pieces = [];
$eqList = [];
$compare = [];
if (!$this->subject->pieceToSet) {
$cnd = [0];
} else {
$cnd = ['i.id', array_keys($this->subject->pieceToSet)];
}
$iList = new ItemList(array($cnd));
$data = $iList->getListviewData(ITEMINFO_SUBITEMS | ITEMINFO_JSON);
foreach ($iList->iterate() as $itemId => $__) {
if (empty($data[$itemId])) {
continue;
}
$slot = $iList->getField('slot');
$disp = $iList->getField('displayId');
if ($slot && $disp) {
$eqList[] = [$slot, $disp];
}
$compare[] = $itemId;
$pieces[] = array('id' => $itemId, 'name' => $iList->getField('name', true), 'quality' => $iList->getField('quality'), 'icon' => $iList->getField('iconString'), 'json' => $data[$itemId]);
}
// spells
$foo = [];
$spells = [];
for ($i = 1; $i < 9; $i++) {
$spl = $this->subject->getField('spell' . $i);
$qty = $this->subject->getField('bonus' . $i);
if ($spl && $qty) {
$foo[] = $spl;
$spells[] = array('id' => $spl, 'bonus' => $qty, 'desc' => '');
}
}
// sort by required pieces ASC
usort($spells, function ($a, $b) {
if ($a['bonus'] == $b['bonus']) {
return 0;
}
return $a['bonus'] > $b['bonus'] ? 1 : -1;
});
$setSpells = new SpellList(array(['s.id', $foo]));
foreach ($setSpells->iterate() as $spellId => $__) {
foreach ($spells as &$s) {
if ($spellId != $s['id']) {
continue;
}
$s['desc'] = $setSpells->parseText('description')[0];
}
}
$skill = '';
if ($_sk = $this->subject->getField('skillId')) {
//.........这里部分代码省略.........
示例4: foreach
?>
</h3>
<?php
echo " " . Lang::itemset('_conveyBonus') . "\n";
?>
<ul>
<?php
foreach ($this->spells as $i => $s) {
echo ' <li><div>' . $s['bonus'] . ' ' . Lang::itemset('_pieces') . Lang::main('colon') . '<a href="?spell=' . $s['id'] . '">' . $s['desc'] . "</a></div></li>\n";
}
?>
</ul>
<h2 class="clear"><?php
echo Lang::itemset('summary');
?>
</h2>
<div id="summary-generic"></div>
<script type="text/javascript">//<![CDATA[
new Summary(<?php
echo Util::toJSON($this->summary);
?>
);
//]]></script>
<h2 class="clear"><?php
echo Lang::main('related');
?>
</h2>
示例5: foreach
if ($str) {
echo ' <option value="' . $i . '"' . (isset($f['cl']) && $i == $f['cl'] ? ' selected' : null) . '>' . $str . "</option>\n";
}
}
?>
</select></td>
<td class="padded">
<table><tr>
<td> <?php
echo Lang::itemset('_tag') . Lang::main('colon');
?>
</td>
<td> <select name="ta">
<option></option>
<?php
foreach (Lang::itemset('notes') as $i => $str) {
if ($str) {
echo ' <option value="' . $i . '"' . (isset($f['ta']) && $i == $f['ta'] ? ' selected' : null) . '>' . $str . "</option>\n";
}
}
?>
</select></td>
</tr></table>
</td>
</tr>
</table>
<div id="fi_criteria" class="padded criteria"><div></div></div>
<div><a href="javascript:;" id="fi_addcriteria" onclick="fi_addCriterion(this); return false"><?php
echo Lang::main('addFilter');
?>