當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Lang::event方法代碼示例

本文整理匯總了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]]);
     }
 }
開發者ID:saqar,項目名稱:aowow,代碼行數:7,代碼來源:events.php

示例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;
//.........這裏部分代碼省略.........
開發者ID:Niknox,項目名稱:aowow,代碼行數:101,代碼來源:quest.php

示例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;
 }
開發者ID:TrinityCore,項目名稱:aowow,代碼行數:9,代碼來源:event.php

示例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'];
         }
     }
 }
開發者ID:Carbenium,項目名稱:aowow,代碼行數:40,代碼來源:event.php

示例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;
 }
開發者ID:saqar,項目名稱:aowow,代碼行數:22,代碼來源:worldevent.class.php


注:本文中的Lang::event方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。