本文整理汇总了PHP中Lang::event方法的典型用法代码示例。如果您正苦于以下问题:PHP Lang::event方法的具体用法?PHP Lang::event怎么用?PHP Lang::event使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lang
的用法示例。
在下文中一共展示了Lang::event方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateTitle
protected function generateTitle()
{
array_unshift($this->title, $this->name);
if ($this->category) {
array_unshift($this->title, Lang::event('category')[$this->category[0]]);
}
}
示例2: 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;
//.........这里部分代码省略.........
示例3: notFound
public function notFound($title = '', $msg = '')
{
if ($this->mode != CACHE_TYPE_TOOLTIP) {
return parent::notFound($title ?: Lang::game('event'), $msg ?: Lang::event('notFound'));
}
header('Content-type: application/x-javascript; charset=utf-8');
echo $this->generateTooltip(true);
exit;
}
示例4: postCache
protected function postCache()
{
/********************/
/* finalize infobox */
/********************/
// update dates to now()
$updated = WorldEventList::updateDates($this->dates);
// start
if ($updated['start']) {
array_push($this->infobox, Lang::event('start') . Lang::main('colon') . date(Lang::main('dateFmtLong'), $updated['start']));
}
// end
if ($updated['end']) {
array_push($this->infobox, Lang::event('end') . Lang::main('colon') . date(Lang::main('dateFmtLong'), $updated['end']));
}
// occurence
if ($updated['rec'] > 0) {
array_push($this->infobox, Lang::event('interval') . Lang::main('colon') . Util::formatTime($updated['rec'] * 1000));
}
// in progress
if ($updated['start'] < time() && $updated['end'] > time()) {
array_push($this->infobox, '[span class=q2]' . Lang::event('inProgress') . '[/span]');
}
$this->infobox = '[ul][li]' . implode('[/li][li]', $this->infobox) . '[/li][/ul]';
/***************************/
/* finalize related events */
/***************************/
foreach ($this->lvTabs as &$view) {
if ($view['file'] != WorldEventList::$brickFile) {
continue;
}
foreach ($view['data'] as &$data) {
$updated = WorldEventList::updateDates($data['_date']);
unset($data['_date']);
$data['startDate'] = $updated['start'] ? date(Util::$dateFormatInternal, $updated['start']) : false;
$data['endDate'] = $updated['end'] ? date(Util::$dateFormatInternal, $updated['end']) : false;
$data['rec'] = $updated['rec'];
}
}
}
示例5: renderTooltip
public function renderTooltip()
{
if (!$this->curTpl) {
return null;
}
$x = '<table><tr><td>';
// head v that extra % is nesecary because we are using sprintf later on
$x .= '<table width="100%%"><tr><td><b>' . Util::jsEscape($this->getField('name', true)) . '</b></td><th><b class="q0">' . Lang::event('category', $this->getField('category')) . '</b></th></tr></table>';
// use string-placeholder for dates
// start
$x .= Lang::event('start') . Lang::main('colon') . '%s<br>';
// end
$x .= Lang::event('end') . Lang::main('colon') . '%s';
$x .= '</td></tr></table>';
// desc
if ($this->getField('holidayId')) {
if ($_ = $this->getField('description', true)) {
$x .= '<table><tr><td><span class="q">' . Util::jsEscape($_) . '</span></td></tr></table>';
}
}
return $x;
}