本文整理汇总了PHP中Lang::getClassString方法的典型用法代码示例。如果您正苦于以下问题:PHP Lang::getClassString方法的具体用法?PHP Lang::getClassString怎么用?PHP Lang::getClassString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lang
的用法示例。
在下文中一共展示了Lang::getClassString方法的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: renderTooltip
//.........这里部分代码省略.........
$hasMatch &= $pop ? $gems[$pop]['colorMask'] & 1 << $colorId ? 1 : 0 : 0;
$icon = $pop ? sprintf(Util::$bgImagePath['tiny'], STATIC_URL, strtolower($gems[$pop]['iconString'])) : null;
$text = $pop ? Util::localizedString($gems[$pop], 'name') : Lang::item('socket', $colorId);
if ($interactive) {
$x .= '<a href="?items=3&filter=cr=81;crs=' . ($colorId + 1) . ';crv=0" class="socket-' . Util::$sockets[$colorId] . ' q' . $col . '" ' . $icon . '>' . $text . '</a><br />';
} else {
$x .= '<span class="socket-' . Util::$sockets[$colorId] . ' q' . $col . '" ' . $icon . '>' . $text . '</span><br />';
}
}
// fill extra socket
if (isset($enhance['s'])) {
$pop = array_pop($enhance['g']);
$col = $pop ? 1 : 0;
$icon = $pop ? sprintf(Util::$bgImagePath['tiny'], STATIC_URL, strtolower($gems[$pop]['iconString'])) : null;
$text = $pop ? Util::localizedString($gems[$pop], 'name') : Lang::item('socket', -1);
if ($interactive) {
$x .= '<a href="?items=3&filter=cr=81;crs=5;crv=0" class="socket-prismatic q' . $col . '" ' . $icon . '>' . $text . '</a><br />';
} else {
$x .= '<span class="socket-prismatic q' . $col . '" ' . $icon . '>' . $text . '</span><br />';
}
} else {
// prismatic socket placeholder
$x .= '<!--ps-->';
}
if ($_ = $this->curTpl['socketBonus']) {
$sbonus = DB::Aowow()->selectRow('SELECT * FROM ?_itemenchantment WHERE Id = ?d', $_);
$x .= '<span class="q' . ($hasMatch ? '2' : '0') . '">' . Lang::item('socketBonus') . Lang::main('colon') . '<a href="?enchantment=' . $_ . '">' . Util::localizedString($sbonus, 'name') . '</a></span><br />';
}
// durability
if ($dur = $this->curTpl['durability']) {
$x .= Lang::item('durability') . ' ' . $dur . ' / ' . $dur . '<br />';
}
// required classes
if ($classes = Lang::getClassString($this->curTpl['requiredClass'], $jsg, $__)) {
foreach ($jsg as $js) {
if (empty($this->jsGlobals[TYPE_CLASS][$js])) {
$this->jsGlobals[TYPE_CLASS][$js] = $js;
}
}
$x .= Lang::game('classes') . Lang::main('colon') . $classes . '<br />';
}
// required races
if ($races = Lang::getRaceString($this->curTpl['requiredRace'], $__, $jsg, $__)) {
foreach ($jsg as $js) {
if (empty($this->jsGlobals[TYPE_RACE][$js])) {
$this->jsGlobals[TYPE_RACE][$js] = $js;
}
}
if ($races != Lang::game('ra', 0)) {
// not "both", but display combinations like: troll, dwarf
$x .= Lang::game('races') . Lang::main('colon') . $races . '<br />';
}
}
// required honorRank (not used anymore)
if ($rhr = $this->curTpl['requiredHonorRank']) {
$x .= sprintf(Lang::game('requires'), Lang::game('pvpRank', $rhr)) . '<br />';
}
// required CityRank..?
// what the f..
// required level
if ($_flags & ITEM_FLAG_ACCOUNTBOUND && $_quality == ITEM_QUALITY_HEIRLOOM) {
$x .= sprintf(Lang::game('reqLevelHlm'), ' 1' . Lang::game('valueDelim') . MAX_LEVEL . ' (' . ($interactive ? sprintf(Util::$changeLevelString, MAX_LEVEL) : '<!--lvl-->' . MAX_LEVEL) . ')') . '<br />';
} else {
if ($_reqLvl > 1) {
$x .= sprintf(Lang::game('reqLevel'), $_reqLvl) . '<br />';
}
示例3: generateContent
protected function generateContent()
{
$this->addJS('?data=zones&locale=' . User::$localeId . '&t=' . $_SESSION['dataKey']);
$_cat = $this->subject->getField('typeCat');
$redButtons = array(BUTTON_LINKS => ['color' => 'ff71d5ff', 'linkId' => Util::$typeStrings[TYPE_SPELL] . ':' . $this->typeId], BUTTON_VIEW3D => false, BUTTON_WOWHEAD => true);
/***********/
/* Infobox */
/***********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// level
if (!in_array($_cat, [-5, -6])) {
if ($_ = $this->subject->getField('talentLevel')) {
$infobox[] = in_array($_cat, [-2, 7, -13]) ? sprintf(Lang::game('reqLevel'), $_) : Lang::game('level') . Lang::main('colon') . $_;
} else {
if ($_ = $this->subject->getField('spellLevel')) {
$infobox[] = in_array($_cat, [-2, 7, -13]) ? sprintf(Lang::game('reqLevel'), $_) : Lang::game('level') . Lang::main('colon') . $_;
}
}
}
// races
if ($_ = Lang::getRaceString($this->subject->getField('reqRaceMask'), $__, $jsg, $n, false)) {
if ($_ != Lang::game('ra', 0)) {
$this->extendGlobalIds(TYPE_RACE, $jsg);
$t = $n == 1 ? Lang::game('race') : Lang::game('races');
$infobox[] = Util::ucFirst($t) . Lang::main('colon') . $_;
}
}
// classes
if ($_ = Lang::getClassString($this->subject->getField('reqClassMask'), $jsg, $n, false)) {
$this->extendGlobalIds(TYPE_CLASS, $jsg);
$t = $n == 1 ? Lang::game('class') : Lang::game('classes');
$infobox[] = Util::ucFirst($t) . Lang::main('colon') . $_;
}
// spell focus
if ($_ = $this->subject->getField('spellFocusObject')) {
$bar = DB::Aowow()->selectRow('SELECT * FROM ?_spellfocusobject WHERE id = ?d', $_);
$focus = new GameObjectList(array(['spellFocusId', $_], 1));
$infobox[] = Lang::game('requires2') . ' ' . ($focus->error ? Util::localizedString($bar, 'name') : '[url=?object=' . $focus->id . ']' . Util::localizedString($bar, 'name') . '[/url]');
}
// primary & secondary trades
if (in_array($_cat, [9, 11])) {
// skill
if ($_ = $this->subject->getField('skillLines')[0]) {
$rSkill = new SkillList(array(['id', $_]));
if (!$rSkill->error) {
$this->extendGlobalData($rSkill->getJSGlobals());
$bar = sprintf(Lang::game('requires'), ' [skill=' . $rSkill->id . ']');
if ($_ = $this->subject->getField('learnedAt')) {
$bar .= ' (' . $_ . ')';
}
$infobox[] = $bar;
}
}
// specialization
if ($_ = $this->subject->getField('reqSpellId')) {
$rSpell = new SpellList(array(['id', $_]));
if (!$rSpell->error) {
$this->extendGlobalData($rSpell->getJSGlobals());
$infobox[] = Lang::game('requires2') . ' [spell=' . $rSpell->id . '][/li]';
}
}
// difficulty
if ($_ = $this->subject->getColorsForCurrent()) {
$bar = [];
for ($i = 0; $i < 4; $i++) {
if ($_[$i]) {
$bar[] = '[color=r' . ($i + 1) . ']' . $_[$i] . '[/color]';
}
}
$infobox[] = Lang::game('difficulty') . Lang::main('colon') . implode(' ', $bar);
}
}
// accquisition.. 10: starter spell; 7: discovery
if (isset($this->subject->sources[$this->subject->id][10])) {
$infobox[] = Lang::spell('starter');
} else {
if (isset($this->subject->sources[$this->subject->id][7])) {
$infobox[] = Lang::spell('discovered');
}
}
// training cost
if ($cost = $this->subject->getField('trainingCost')) {
$infobox[] = Lang::spell('trainingCost') . Lang::main('colon') . '[money=' . $cost . '][/li]';
}
// used in mode
foreach ($this->difficulties as $n => $id) {
if ($id == $this->typeId) {
// "Mode" seems to be multilingual acceptable
$infobox[] = 'Mode' . Lang::main('colon') . Lang::game('modes', $n);
}
}
$effects = $this->createEffects($infobox, $redButtons);
// spell script
if (User::isInGroup(U_GROUP_STAFF)) {
if ($_ = DB::World()->selectCell('SELECT ScriptName FROM spell_script_names WHERE ABS(spell_id) = ?d', $this->firstRank)) {
$infobox[] = 'Script' . Lang::main('colon') . $_;
}
}
$infobox = $infobox ? '[ul][li]' . implode('[/li][li]', $infobox) . '[/li][/ul]' : '';
// append glyph symbol if available
//.........这里部分代码省略.........
示例4: generateContent
protected function generateContent()
{
$_level = $this->subject->getField('level');
$_minLevel = $this->subject->getField('minLevel');
$_flags = $this->subject->getField('flags');
$_specialFlags = $this->subject->getField('specialFlags');
$_side = Util::sideByRaceMask($this->subject->getField('reqRaceMask'));
/***********/
/* Infobox */
/***********/
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
// event (todo: assign eventData)
if ($_ = $this->subject->getField('eventId')) {
$this->extendGlobalIds(TYPE_WORLDEVENT, $_);
$infobox[] = Lang::game('eventShort') . Lang::main('colon') . '[event=' . $_ . ']';
}
// level
if ($_level > 0) {
$infobox[] = Lang::game('level') . Lang::main('colon') . $_level;
}
// reqlevel
if ($_minLevel) {
$lvl = $_minLevel;
if ($_ = $this->subject->getField('maxLevel')) {
$lvl .= ' - ' . $_;
}
$infobox[] = sprintf(Lang::game('reqLevel'), $lvl);
}
// loremaster (i dearly hope those flags cover every case...)
if ($this->subject->getField('zoneOrSortBak') > 0 && !$this->subject->isRepeatable()) {
$conditions = array(['ac.type', ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUESTS_IN_ZONE], ['ac.value1', $this->subject->getField('zoneOrSortBak')], ['a.faction', $_side, '&']);
$loremaster = new AchievementList($conditions);
$this->extendGlobalData($loremaster->getJSGlobals(GLOBALINFO_SELF));
switch ($loremaster->getMatches()) {
case 0:
break;
case 1:
$infobox[] = Lang::quest('loremaster') . Lang::main('colon') . '[achievement=' . $loremaster->id . ']';
break;
default:
$lm = Lang::quest('loremaster') . Lang::main('colon') . '[ul]';
foreach ($loremaster->iterate() as $id => $__) {
$lm .= '[li][achievement=' . $id . '][/li]';
}
$infobox[] = $lm . '[/ul]';
break;
}
}
// type (maybe expand uppon?)
$_ = [];
if ($_flags & QUEST_FLAG_DAILY) {
$_[] = Lang::quest('daily');
} else {
if ($_flags & QUEST_FLAG_WEEKLY) {
$_[] = Lang::quest('weekly');
} else {
if ($_specialFlags & QUEST_FLAG_SPECIAL_MONTHLY) {
$_[] = Lang::quest('monthly');
}
}
}
if ($t = $this->subject->getField('type')) {
$_[] = Lang::quest('questInfo', $t);
}
if ($_) {
$infobox[] = Lang::game('type') . Lang::main('colon') . implode(' ', $_);
}
// side
$_ = Lang::main('side') . Lang::main('colon');
switch ($_side) {
case 3:
$infobox[] = $_ . Lang::game('si', 3);
break;
case 2:
$infobox[] = $_ . '[span class=icon-horde]' . Lang::game('si', 2) . '[/span]';
break;
case 1:
$infobox[] = $_ . '[span class=icon-alliance]' . Lang::game('si', 1) . '[/span]';
break;
}
// races
if ($_ = Lang::getRaceString($this->subject->getField('reqRaceMask'), $__, $jsg, $n, false)) {
$this->extendGlobalIds(TYPE_RACE, $jsg);
$t = $n == 1 ? Lang::game('race') : Lang::game('races');
$infobox[] = Util::ucFirst($t) . Lang::main('colon') . $_;
}
// classes
if ($_ = Lang::getClassString($this->subject->getField('reqClassMask'), $jsg, $n, false)) {
$this->extendGlobalIds(TYPE_CLASS, $jsg);
$t = $n == 1 ? Lang::game('class') : Lang::game('classes');
$infobox[] = Util::ucFirst($t) . Lang::main('colon') . $_;
}
// profession / skill
if ($_ = $this->subject->getField('reqSkillId')) {
$this->extendGlobalIds(TYPE_SKILL, $_);
$sk = '[skill=' . $_ . ']';
if ($_ = $this->subject->getField('reqSkillPoints')) {
$sk .= ' (' . $_ . ')';
}
$infobox[] = Lang::quest('profession') . Lang::main('colon') . $sk;
//.........这里部分代码省略.........
示例5: 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');
}
// worldevent
if ($e = $this->subject->getField('eventId')) {
$infobox[] = Lang::game('eventShort') . Lang::main('colon') . '[event=' . $e . ']';
$this->extendGlobalIds(TYPE_WORLDEVENT, $e);
}
// 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]);
}
$skill = '';
if ($_sk = $this->subject->getField('skillId')) {
$spellLink = sprintf('<a href="?spells=11.%s">%s</a> (%s)', $_sk, Lang::spell('cat', 11, $_sk, 0), $this->subject->getField('skillLevel'));
$skill = ' – <small><b>' . sprintf(Lang::game('requires'), $spellLink) . '</b></small>';
}
$this->bonusExt = $skill;
$this->description = $_ta ? sprintf(Lang::itemset('_desc'), $this->name, Lang::itemset('notes', $_ta), $_cnt) : sprintf(Lang::itemset('_descTagless'), $this->name, $_cnt);
$this->unavailable = $this->subject->getField('cuFlags') & CUSTOM_UNAVAILABLE;
$this->infobox = $infobox ? '[ul][li]' . implode('[/li][li]', $infobox) . '[/li][/ul]' : null;
$this->pieces = $pieces;
$this->spells = $this->subject->getBonuses();
$this->expansion = 0;
$this->redButtons = array(BUTTON_WOWHEAD => $this->typeId > 0, BUTTON_LINKS => ['color' => '', 'linkId' => ''], BUTTON_VIEW3D => ['type' => TYPE_ITEMSET, 'typeId' => $this->typeId, 'equipList' => $eqList], BUTTON_COMPARE => ['eqList' => implode(':', $compare), 'qty' => $_cnt]);
$this->compare = array('level' => $this->subject->getField('reqLevel'), 'items' => array_map(function ($v) {
return [[$v]];
}, $compare));
/**************/
/* Extra Tabs */
/**************/
// related sets (priority: 1: similar tag + class; 2: has event; 3: no tag + similar type, 4: similar type + profession)
$rel = [];
if ($_ta && count($this->path) == 3) {
$rel[] = ['id', $this->typeId, '!'];
$rel[] = ['classMask', 1 << end($this->path) - 1, '&'];
$rel[] = ['contentGroup', (int) $_ta];
} else {
if ($this->subject->getField('eventId')) {
$rel[] = ['id', $this->typeId, '!'];
$rel[] = ['eventId', 0, '!'];
//.........这里部分代码省略.........