当前位置: 首页>>代码示例>>PHP>>正文


PHP ItemList::getMatches方法代码示例

本文整理汇总了PHP中ItemList::getMatches方法的典型用法代码示例。如果您正苦于以下问题:PHP ItemList::getMatches方法的具体用法?PHP ItemList::getMatches怎么用?PHP ItemList::getMatches使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ItemList的用法示例。


在下文中一共展示了ItemList::getMatches方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _searchItem

 private function _searchItem($cndBase, &$shared)
 {
     $result = [];
     $miscData = [];
     $cndAdd = empty($this->query) ? [] : (is_int($this->query) ? ['id', $this->query] : $this->createLookup());
     if ($this->searchMask & SEARCH_TYPE_JSON && $this->searchMask & 0x20 && !empty($shared['pcsToSet'])) {
         $cnd = [['i.id', array_keys($shared['pcsToSet'])], CFG_SQL_LIMIT_NONE];
         $miscData = ['pcsToSet' => $shared['pcsToSet']];
     } else {
         if ($this->searchMask & SEARCH_TYPE_JSON && $this->searchMask & 0x40) {
             $cnd = $cndBase;
             $cnd[] = ['i.class', [ITEM_CLASS_WEAPON, ITEM_CLASS_GEM, ITEM_CLASS_ARMOR]];
             $cnd[] = $cndAdd;
             $slots = isset($_GET['slots']) ? explode(':', $_GET['slots']) : [];
             array_walk($slots, function (&$v, $k) {
                 $v = intVal($v);
             });
             if ($_ = array_filter($slots)) {
                 $cnd[] = ['slot', $_];
             }
             $itemFilter = new ItemListFilter();
             if ($_ = $itemFilter->createConditionsForWeights($this->statWeight)) {
                 $miscData['extraOpts'] = $itemFilter->extraOpts;
                 $cnd = array_merge($cnd, [$_]);
             }
         } else {
             $cnd = array_merge($cndBase, [$cndAdd]);
         }
     }
     $items = new ItemList($cnd, $miscData);
     if ($data = $items->getListviewData($this->searchMask & SEARCH_TYPE_JSON ? ITEMINFO_SUBITEMS | ITEMINFO_JSON : 0)) {
         if ($this->searchMask & SEARCH_TYPE_REGULAR) {
             $this->extendGlobalData($items->getJSGlobals());
         }
         if ($this->searchMask & SEARCH_TYPE_OPEN) {
             foreach ($items->iterate() as $__) {
                 $data[$items->id]['param1'] = $items->getField('iconString');
                 $data[$items->id]['param2'] = $items->getField('quality');
             }
         }
         $result = array('type' => TYPE_ITEM, 'appendix' => ' (Item)', 'matches' => $items->getMatches(), 'file' => ItemList::$brickFile, 'data' => $data, 'params' => []);
         if ($items->getMatches() > $this->maxResults) {
             $result['params']['note'] = sprintf(Util::$tryNarrowingString, 'LANG.lvnote_itemsfound', $items->getMatches(), $this->maxResults);
             $result['params']['_truncated'] = 1;
         }
         if (isset($result['params']['note'])) {
             $result['params']['note'] .= ' + LANG.dash + $WH.sprintf(LANG.lvnote_filterresults, \'?items&filter=na=' . urlencode($this->search) . '\')';
         } else {
             $result['params']['note'] = '$$WH.sprintf(LANG.lvnote_filterresults, \'?items&filter=na=' . urlencode($this->search) . '\')';
         }
     }
     return $result;
 }
开发者ID:Niknox,项目名称:aowow,代码行数:53,代码来源:search.php

示例2: generateContent


//.........这里部分代码省略.........
             $infobox[] = Lang::currency('cap') . Lang::main('colon') . '75\'000';
         }
     }
     /****************/
     /* Main Content */
     /****************/
     $this->infobox = $infobox ? '[ul][li]' . implode('[/li][li]', $infobox) . '[/li][/ul]' : null;
     $this->name = $this->subject->getField('name', true);
     $this->headIcons = $this->typeId == 104 ? ['inv_bannerpvp_02', 'inv_bannerpvp_01'] : [$this->subject->getField('iconString')];
     $this->redButtons = array(BUTTON_WOWHEAD => true, BUTTON_LINKS => true);
     /**************/
     /* Extra Tabs */
     /**************/
     if ($this->typeId != 103 && $this->typeId != 104) {
         // tabs: this currency is contained in..
         $lootTabs = new Loot();
         if ($lootTabs->getByItem($_itemId)) {
             $this->extendGlobalData($lootTabs->jsGlobals);
             foreach ($lootTabs->iterate() as $tab) {
                 $this->lvTabs[] = array('file' => $tab[0], 'data' => $tab[1], 'params' => ['name' => $tab[2], 'id' => $tab[3], 'extraCols' => $tab[4] ? '$[' . implode(', ', array_unique($tab[4])) . ']' : null, 'hiddenCols' => $tab[5] ? '$[' . implode(', ', array_unique($tab[5])) . ']' : null, 'visibleCols' => $tab[6] ? '$' . Util::toJSON(array_unique($tab[6])) : null]);
             }
         }
         // tab: sold by
         $itemObj = new ItemList(array(['id', $_itemId]));
         if (!empty($itemObj->getExtendedCost()[$_itemId])) {
             $vendors = $itemObj->getExtendedCost()[$_itemId];
             $this->extendGlobalData($itemObj->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
             $soldBy = new CreatureList(array(['id', array_keys($vendors)]));
             if (!$soldBy->error) {
                 $sbData = $soldBy->getListviewData();
                 $extraCols = ['Listview.extraCols.stock', "Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack')", 'Listview.extraCols.cost'];
                 $holidays = [];
                 foreach ($sbData as $k => &$row) {
                     $items = [];
                     $tokens = [];
                     foreach ($vendors[$k] as $id => $qty) {
                         if (is_string($id)) {
                             continue;
                         }
                         if ($id > 0) {
                             $tokens[] = [$id, $qty];
                         } else {
                             if ($id < 0) {
                                 $items[] = [-$id, $qty];
                             }
                         }
                     }
                     if ($vendors[$k]['event']) {
                         if (count($extraCols) == 3) {
                             // not already pushed
                             $extraCols[] = 'Listview.extraCols.condition';
                         }
                         $this->extendGlobalIds(TYPE_WORLDEVENT, $vendors[$k]['event']);
                         $row['condition'][0][$this->typeId][] = [[CND_ACTIVE_EVENT, $vendors[$k]['event']]];
                     }
                     $row['stock'] = $vendors[$k]['stock'];
                     $row['stack'] = $itemObj->getField('buyCount');
                     $row['cost'] = array($itemObj->getField('buyPrice'), $items ? $items : null, $tokens ? $tokens : null);
                 }
                 $this->lvTabs[] = array('file' => 'creature', 'data' => $sbData, 'params' => ['name' => '$LANG.tab_soldby', 'id' => 'sold-by-npc', 'extraCols' => '$[' . implode(', ', $extraCols) . ']', 'hiddenCols' => "\$['level', 'type']"]);
             }
         }
     }
     // tab: created by (spell) [for items its handled in Loot::getByContainer()]
     if ($this->typeId == 104) {
         $createdBy = new SpellList(array(['effect1Id', 45], ['effect2Id', 45], ['effect3Id', 45], 'OR'));
         if (!$createdBy->error) {
             $this->extendGlobalData($createdBy->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
             if ($createdBy->hasSetFields(['reagent1'])) {
                 $visCols = ['reagents'];
             }
             $this->lvTabs[] = array('file' => 'spell', 'data' => $createdBy->getListviewData(), 'params' => ['name' => '$LANG.tab_createdby', 'id' => 'created-by', 'visibleCols' => isset($visCols) ? '$' . Util::toJSON($visCols) : null]);
         }
     }
     // tab: currency for
     if ($this->typeId == 103) {
         $n = '?items&filter=cr=145;crs=1;crv=0';
         $w = 'reqArenaPoints > 0';
     } else {
         if ($this->typeId == 104) {
             $n = '?items&filter=cr=144;crs=1;crv=0';
             $w = 'reqHonorPoints > 0';
         } else {
             $n = in_array($this->typeId, [42, 61, 81, 241, 121, 122, 123, 125, 126, 161, 201, 101, 102, 221, 301, 341]) ? '?items&filter=cr=158;crs=' . $_itemId . ';crv=0' : null;
             $w = 'reqItemId1 = ' . $_itemId . ' OR reqItemId2 = ' . $_itemId . ' OR reqItemId3 = ' . $_itemId . ' OR reqItemId4 = ' . $_itemId . ' OR reqItemId5 = ' . $_itemId;
         }
     }
     $xCosts = DB::Aowow()->selectCol('SELECT id FROM ?_itemextendedcost WHERE ' . $w);
     $boughtBy = $xCosts ? DB::World()->selectCol('SELECT item FROM npc_vendor WHERE extendedCost IN (?a) UNION SELECT item FROM game_event_npc_vendor WHERE extendedCost IN (?a)', $xCosts, $xCosts) : [];
     if ($boughtBy) {
         $boughtBy = new ItemList(array(['id', $boughtBy]));
         if (!$boughtBy->error) {
             if ($boughtBy->getMatches() <= CFG_SQL_LIMIT_DEFAULT) {
                 $n = null;
             }
             $this->lvTabs[] = array('file' => 'item', 'data' => $boughtBy->getListviewData(ITEMINFO_VENDOR, [TYPE_CURRENCY => $this->typeId]), 'params' => ['name' => '$LANG.tab_currencyfor', 'id' => 'currency-for', 'extraCols' => "\$[Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack')]", 'note' => $n ? sprintf(Util::$filterResultString, $n) : null]);
             $this->extendGlobalData($boughtBy->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
         }
     }
 }
开发者ID:Carbenium,项目名称:aowow,代码行数:101,代码来源:currency.php

示例3: generateContent


//.........这里部分代码省略.........
         if ($upgItemData) {
             if ($grouping == 1) {
                 $upg = array_keys(array_filter($this->filter['upg'], function ($v) use($group) {
                     return $v == $group;
                 }));
                 foreach ($upg as $uId) {
                     $tabData['data'][$uId] = $upgItemData[$uId];
                 }
                 if ($upg) {
                     $tabData['_upgradeIds'] = $upg;
                 }
             } else {
                 if ($grouping) {
                     $upg = array_keys($this->filter['upg']);
                     $tabData['_upgradeIds'] = $upg;
                     foreach ($upgItemData as $uId => $data) {
                         // using numeric keys => cant use array_merge
                         $tabData['data'][$uId] = $data;
                     }
                 }
             }
         }
         if ($grouping) {
             switch ($grouping) {
                 case 1:
                     $tabData['id'] = 'slot-' . $group;
                     break;
                 case 2:
                     $tabData['id'] = $group > 0 ? 'level-' . $group : 'other';
                     break;
                 case 3:
                     $tabData['id'] = $group ? 'source-' . $group : 'unknown';
                     break;
             }
             $tabData['name'] = $nameSource[$group];
             $tabData['tabs'] = '$tabsGroups';
         }
         if (!empty($this->filter['fi']['setWeights'])) {
             if ($items->hasSetFields(['armor'])) {
                 $tabData['visibleCols'][] = 'armor';
             }
         }
         // create note if search limit was exceeded; overwriting 'note' is intentional
         if ($items->getMatches() > $maxResults && count($groups) > 1) {
             $tabData['_truncated'] = 1;
             $cls = isset($this->category[0]) ? '=' . $this->category[0] : '';
             $override = ['gb' => ''];
             if ($upg) {
                 $override['upg'] = implode(':', $upg);
             }
             switch ($grouping) {
                 case 1:
                     $override['sl'] = $group;
                     $tabData['note'] = '$$WH.sprintf(LANG.lvnote_viewmoreslot, \'' . $cls . '\', \'' . $this->filterObj->urlize($override) . '\')';
                     break;
                 case 2:
                     if ($group > 0) {
                         $override['minle'] = $group;
                         $override['maxle'] = $group;
                     } else {
                         $override['maxle'] = abs($group) - 1;
                     }
                     $tabData['note'] = '$$WH.sprintf(LANG.lvnote_viewmorelevel, \'' . $cls . '\', \'' . $this->filterObj->urlize($override) . '\')';
                     break;
                 case 3:
                     if ($_ = [null, 3, 4, 5, 6, 7, 9, 10, 11][$group]) {
                         $tabData['note'] = '$$WH.sprintf(LANG.lvnote_viewmoresource, \'' . $cls . '\', \'' . $this->filterObj->urlize($override, ['cr' => 128, 'crs' => $_, 'crv' => 0]) . '\')';
                     }
                     break;
             }
         } else {
             if ($items->getMatches() > $maxResults) {
                 $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsfound', $items->getMatches(), CFG_SQL_LIMIT_DEFAULT);
                 $tabData['_truncated'] = 1;
             }
         }
         foreach ($tabData as $k => $p) {
             if (!$p && $k != 'data') {
                 unset($tabData[$k]);
             }
         }
         if ($grouping) {
             $tabData['hideCount'] = 1;
         }
         $tabData['data'] = array_values($tabData['data']);
         $this->lvTabs[] = ['item', $tabData];
     }
     // reformat for use in template
     if (!empty($this->filter['upg'])) {
         $this->filter['upg'] = implode(':', array_keys($this->filter['upg']));
     }
     // whoops, we have no data? create emergency content
     if (empty($this->lvTabs)) {
         $this->forceTabs = false;
         $this->lvTabs[] = ['item', ['data' => []]];
     }
     // sort for dropdown-menus
     Lang::sort('game', 'ra');
     Lang::sort('game', 'cl');
 }
开发者ID:TrinityCore,项目名称:aowow,代码行数:101,代码来源:items.php

示例4: generateContent


//.........这里部分代码省略.........
                     $buff .= '[tr][td]' . Lang::game('quests') . ' (' . Lang::quest('daily') . ')' . Lang::main('colon') . '[/td]';
                     break;
                 case 'quest_weekly_rate':
                     $buff .= '[tr][td]' . Lang::game('quests') . ' (' . Lang::quest('weekly') . ')' . Lang::main('colon') . '[/td]';
                     break;
                 case 'quest_monthly_rate':
                     $buff .= '[tr][td]' . Lang::game('quests') . ' (' . Lang::quest('monthly') . ')' . Lang::main('colon') . '[/td]';
                     break;
                 case 'creature_rate':
                     $buff .= '[tr][td]' . Lang::game('npcs') . Lang::main('colon') . '[/td]';
                     break;
                 case 'spell_rate':
                     $buff .= '[tr][td]' . Lang::game('spells') . Lang::main('colon') . '[/td]';
                     break;
             }
             $buff .= '[td width=35px align=right][span class=q' . ($v < 1 ? '10]' : '2]+') . intVal(($v - 1) * 100) . '%[/span][/td][/tr]';
         }
         if ($buff) {
             $this->extraText .= '[h3 class=clear]' . Lang::faction('customRewRate') . '[/h3][table]' . $buff . '[/table]';
         }
     }
     // factionchange-equivalent
     if ($pendant = DB::World()->selectCell('SELECT IF(horde_id = ?d, alliance_id, -horde_id) FROM player_factionchange_reputations WHERE alliance_id = ?d OR horde_id = ?d', $this->typeId, $this->typeId, $this->typeId)) {
         $altFac = new FactionList(array(['id', abs($pendant)]));
         if (!$altFac->error) {
             $this->transfer = sprintf(Lang::faction('_transfer'), $altFac->id, $altFac->getField('name', true), $pendant > 0 ? 'alliance' : 'horde', $pendant > 0 ? Lang::game('si', 1) : Lang::game('si', 2));
         }
     }
     /**************/
     /* Extra Tabs */
     /**************/
     // tab: items
     $items = new ItemList(array(['requiredFaction', $this->typeId]));
     if (!$items->error) {
         $this->extendGlobalData($items->getJSGlobals(GLOBALINFO_SELF));
         $tabData = array('data' => array_values($items->getListviewData()), 'extraCols' => '$_', 'sort' => ['standing', 'name']);
         if ($items->getMatches() > CFG_SQL_LIMIT_DEFAULT) {
             $tabData['note'] = sprintf(Util::$filterResultString, '?items&filter=cr=17;crs=' . $this->typeId . ';crv=0');
         }
         $this->lvTabs[] = ['item', $tabData, 'itemStandingCol'];
     }
     // tab: creatures with onKill reputation
     if ($this->subject->getField('reputationIndex') != -1) {
         // inherit siblings/children from $spillover
         $cRep = DB::World()->selectCol('SELECT DISTINCT creature_id AS ARRAY_KEY, qty FROM (
                 SELECT creature_id, RewOnKillRepValue1 as qty FROM creature_onkill_reputation WHERE RewOnKillRepValue1 > 0 AND (RewOnKillRepFaction1 = ?d{ OR (RewOnKillRepFaction1 IN (?a) AND IsTeamAward1 <> 0)}) UNION
                 SELECT creature_id, RewOnKillRepValue2 as qty FROM creature_onkill_reputation WHERE RewOnKillRepValue2 > 0 AND (RewOnKillRepFaction2 = ?d{ OR (RewOnKillRepFaction2 IN (?a) AND IsTeamAward2 <> 0)})
             ) x', $this->typeId, $spillover->getFoundIDs() ?: DBSIMPLE_SKIP, $this->typeId, $spillover->getFoundIDs() ?: DBSIMPLE_SKIP);
         if ($cRep) {
             $killCreatures = new CreatureList(array(['id', array_keys($cRep)]));
             if (!$killCreatures->error) {
                 $data = $killCreatures->getListviewData();
                 foreach ($data as $id => &$d) {
                     $d['reputation'] = $cRep[$id];
                 }
                 $tabData = array('data' => array_values($data), 'extraCols' => '$_', 'sort' => ['-reputation', 'name']);
                 if ($killCreatures->getMatches() > CFG_SQL_LIMIT_DEFAULT) {
                     $tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=42;crs=' . $this->typeId . ';crv=0');
                 }
                 $this->lvTabs[] = ['creature', $tabData, 'npcRepCol'];
             }
         }
     }
     // tab: members
     if ($_ = $this->subject->getField('templateIds')) {
         $members = new CreatureList(array(['faction', $_]));
         if (!$members->error) {
             $tabData = array('data' => array_values($members->getListviewData()), 'id' => 'member', 'name' => '$LANG.tab_members');
             if ($members->getMatches() > CFG_SQL_LIMIT_DEFAULT) {
                 $tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=3;crs=' . $this->typeId . ';crv=0');
             }
             $this->lvTabs[] = ['creature', $tabData];
         }
     }
     // tab: objects
     if ($_ = $this->subject->getField('templateIds')) {
         $objects = new GameObjectList(array(['faction', $_]));
         if (!$objects->error) {
             $this->lvTabs[] = ['object', ['data' => array_values($objects->getListviewData())]];
         }
     }
     // tab: quests
     $conditions = array(['AND', ['rewardFactionId1', $this->typeId], ['rewardFactionValue1', 0, '>']], ['AND', ['rewardFactionId2', $this->typeId], ['rewardFactionValue2', 0, '>']], ['AND', ['rewardFactionId3', $this->typeId], ['rewardFactionValue3', 0, '>']], ['AND', ['rewardFactionId4', $this->typeId], ['rewardFactionValue4', 0, '>']], ['AND', ['rewardFactionId5', $this->typeId], ['rewardFactionValue5', 0, '>']], 'OR');
     $quests = new QuestList($conditions);
     if (!$quests->error) {
         $this->extendGlobalData($quests->getJSGlobals(GLOBALINFO_ANY));
         $tabData = array('data' => array_values($quests->getListviewData($this->typeId)), 'extraCols' => '$_');
         if ($quests->getMatches() > CFG_SQL_LIMIT_DEFAULT) {
             $tabData['note'] = sprintf(Util::$filterResultString, '?quests&filter=cr=1;crs=' . $this->typeId . ';crv=0');
         }
         $this->lvTabs[] = ['quest', $tabData, 'questRepCol'];
     }
     // tab: achievements
     $conditions = array(['ac.type', ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION], ['ac.value1', $this->typeId]);
     $acvs = new AchievementList($conditions);
     if (!$acvs->error) {
         $this->extendGlobalData($acvs->getJSGlobals(GLOBALINFO_ANY));
         $this->lvTabs[] = ['achievement', array('data' => array_values($acvs->getListviewData()), 'id' => 'criteria-of', 'name' => '$LANG.tab_criteriaof', 'visibleCols' => ['category'])];
     }
 }
开发者ID:TrinityCore,项目名称:aowow,代码行数:101,代码来源:faction.php

示例5: generateContent


//.........这里部分代码省略.........
                     $row['cost'][] = $currency;
                 }
                 if ($tokens) {
                     $row['cost'][] = $tokens;
                 }
                 if ($x = $this->subject->getField('buyPrice')) {
                     $row['buyprice'] = $x;
                 }
                 if ($x = $this->subject->getField('sellPrice')) {
                     $row['sellprice'] = $x;
                 }
                 if ($x = $this->subject->getField('buyCount')) {
                     $row['stack'] = $x;
                 }
             }
             $this->lvTabs[] = array('file' => 'creature', 'data' => $sbData, 'params' => ['name' => '$LANG.tab_soldby', 'id' => 'sold-by-npc', 'extraCols' => '$[' . implode(', ', $extraCols) . ']', 'hiddenCols' => "\$['level', 'type']"]);
         }
     }
     // tab: currency for
     // some minor trickery: get arenaPoints(43307) and honorPoints(43308) directly
     if ($this->typeId == 43307) {
         $n = '?items&filter=cr=145;crs=1;crv=0';
         $w = 'reqArenaPoints > 0';
     } else {
         if ($this->typeId == 43308) {
             $n = '?items&filter=cr=144;crs=1;crv=0';
             $w = 'reqHonorPoints > 0';
         } else {
             $n = in_array($this->typeId, [42, 61, 81, 241, 121, 122, 123, 125, 126, 161, 201, 101, 102, 221, 301, 341]) ? '?items&filter=cr=158;crs=' . $this->typeId . ';crv=0' : null;
             $w = 'reqItemId1 = ' . $this->typeId . ' OR reqItemId2 = ' . $this->typeId . ' OR reqItemId3 = ' . $this->typeId . ' OR reqItemId4 = ' . $this->typeId . ' OR reqItemId5 = ' . $this->typeId;
         }
     }
     $xCosts = DB::Aowow()->selectCol('SELECT id FROM ?_itemextendedcost WHERE ' . $w);
     $boughtBy = $xCosts ? DB::World()->selectCol('SELECT item FROM npc_vendor WHERE extendedCost IN (?a) UNION SELECT item FROM game_event_npc_vendor WHERE extendedCost IN (?a)', $xCosts, $xCosts) : null;
     if ($boughtBy) {
         $boughtBy = new ItemList(array(['id', $boughtBy]));
         if (!$boughtBy->error) {
             if ($boughtBy->getMatches() <= CFG_SQL_LIMIT_DEFAULT) {
                 $n = null;
             }
             $iCur = new CurrencyList(array(['itemId', $this->typeId]));
             $filter = $iCur->error ? [TYPE_ITEM => $this->typeId] : [TYPE_CURRENCY => $iCur->id];
             $this->lvTabs[] = array('file' => 'item', 'data' => $boughtBy->getListviewData(ITEMINFO_VENDOR, $filter), 'params' => ['name' => '$LANG.tab_currencyfor', 'id' => 'currency-for', 'extraCols' => "\$[Listview.funcBox.createSimpleCol('stack', 'stack', '10%', 'stack'), Listview.extraCols.cost]", 'note' => $n ? sprintf(Util::$filterResultString, $n) : null]);
             $this->extendGlobalData($boughtBy->getJSGlobals(GLOBALINFO_ANY));
         }
     }
     // tab: teaches
     $ids = $indirect = [];
     for ($i = 1; $i < 6; $i++) {
         if ($this->subject->getField('spellTrigger' . $i) == 6) {
             $ids[] = $this->subject->getField('spellId' . $i);
         } else {
             if ($this->subject->getField('spellTrigger' . $i) == 0 && $this->subject->getField('spellId' . $i) > 0) {
                 $indirect[] = $this->subject->getField('spellId' . $i);
             }
         }
     }
     // taught indirectly
     if ($indirect) {
         $indirectSpells = new SpellList(array(['id', $indirect]));
         foreach ($indirectSpells->iterate() as $__) {
             if ($_ = $indirectSpells->canTeachSpell()) {
                 foreach ($_ as $idx) {
                     $ids[] = $indirectSpells->getField('effect' . $idx . 'TriggerSpell');
                 }
             }
         }
         $ids = array_merge($ids, Util::getTaughtSpells($indirect));
     }
     if ($ids) {
         $taughtSpells = new SpellList(array(['id', $ids]));
         if (!$taughtSpells->error) {
             $this->extendGlobalData($taughtSpells->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
             $visCols = ['level', 'schools'];
             if ($taughtSpells->hasSetFields(['reagent1'])) {
                 $visCols[] = 'reagents';
             }
             $this->lvTabs[] = array('file' => 'spell', 'data' => $taughtSpells->getListviewData(), 'params' => ['name' => '$LANG.tab_teaches', 'id' => 'teaches', 'visibleCols' => '$' . Util::toJSON($visCols)]);
         }
     }
     // tab: Shared cooldown
     $cdCats = [];
     for ($i = 1; $i < 6; $i++) {
         if ($this->subject->getField('spellId' . $i) > 0 && $this->subject->getField('spellCategory' . $i) > 0) {
             $cdCats[] = $this->subject->getField('spellCategory' . $i);
         }
     }
     if ($cdCats) {
         $conditions = array('OR', ['spellCategory1', $cdCats], ['spellCategory2', $cdCats], ['spellCategory3', $cdCats], ['spellCategory4', $cdCats], ['spellCategory5', $cdCats]);
         $cdItems = new ItemList($conditions);
         if (!$cdItems->error) {
             $this->lvTabs[] = array('file' => 'item', 'data' => $cdItems->getListviewData(), 'params' => ['name' => '$LANG.tab_sharedcooldown', 'id' => 'shared-cooldown']);
             $this->extendGlobalData($cdItems->getJSGlobals(GLOBALINFO_SELF));
         }
     }
     // // todo - tab: taught by
     // use var $createdBy to find source of this spell
     // id: 'taught-by-X',
     // name: LANG.tab_taughtby
 }
开发者ID:Carbenium,项目名称:aowow,代码行数:101,代码来源:item.php


注:本文中的ItemList::getMatches方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。