diff --git a/includes/types/creature.class.php b/includes/types/creature.class.php index 68b092a2..1f6a358e 100644 --- a/includes/types/creature.class.php +++ b/includes/types/creature.class.php @@ -9,7 +9,7 @@ class CreatureList extends BaseType use spawnHelper; public static $type = Type::NPC; - public static $brickFile = 'creature'; + public static $brickFile = 'npc'; public static $dataTable = '?_creature'; protected $queryBase = 'SELECT ct.*, ct.id AS ARRAY_KEY FROM ?_creature ct'; diff --git a/includes/types/icon.class.php b/includes/types/icon.class.php index 7a7dedd3..538c2402 100644 --- a/includes/types/icon.class.php +++ b/includes/types/icon.class.php @@ -9,7 +9,7 @@ class IconList extends BaseType use listviewHelper; public static $type = Type::ICON; - public static $brickFile = 'icon'; + public static $brickFile = 'icongallery'; public static $dataTable = '?_icons'; public static $contribute = CONTRIBUTE_CO; diff --git a/pages/achievement.php b/pages/achievement.php index 21891494..f86b4c6a 100644 --- a/pages/achievement.php +++ b/pages/achievement.php @@ -236,7 +236,7 @@ class AchievementPage extends GenericPage ['id', $this->typeId, '!'] ); $saList = new AchievementList($conditions); - $this->lvTabs[] = ['achievement', array( + $this->lvTabs[] = [AchievementList::$brickFile, array( 'data' => array_values($saList->getListviewData()), 'id' => 'see-also', 'name' => '$LANG.tab_seealso', @@ -252,7 +252,7 @@ class AchievementPage extends GenericPage if (!empty($refs)) { $coList = new AchievementList(array(['id', $refs])); - $this->lvTabs[] = ['achievement', array( + $this->lvTabs[] = [AchievementList::$brickFile, array( 'data' => array_values($coList->getListviewData()), 'id' => 'criteria-of', 'name' => '$LANG.tab_criteriaof', diff --git a/pages/achievements.php b/pages/achievements.php index d4e8ef60..4872ec84 100644 --- a/pages/achievements.php +++ b/pages/achievements.php @@ -115,7 +115,7 @@ class AchievementsPage extends GenericPage $tabData['_errors'] = 1; } - $this->lvTabs[] = ['achievement', $tabData]; + $this->lvTabs[] = [AchievementList::$brickFile, $tabData]; } protected function postCache() diff --git a/pages/admin.php b/pages/admin.php index 57aa1d0c..92259b90 100644 --- a/pages/admin.php +++ b/pages/admin.php @@ -289,7 +289,7 @@ class AdminPage extends GenericPage $data[$id]['rev'] = $rev; } - $this->lvTabs[] = ['guide', array( + $this->lvTabs[] = [GuideList::$brickFile, array( 'data' => array_values($data), 'hiddenCols' => ['patch', 'comments', 'views', 'rating'], 'extraCols' => '$_' diff --git a/pages/areatrigger.php b/pages/areatrigger.php index c32763a4..4d867104 100644 --- a/pages/areatrigger.php +++ b/pages/areatrigger.php @@ -121,7 +121,7 @@ class AreaTriggerPage extends GenericPage if (!$relQuest->error) { $this->extendGlobalData($relQuest->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_REWARDS)); - $this->lvTabs[] = ['quest', ['data' => array_values($relQuest->getListviewData())]]; + $this->lvTabs[] = [QuestList::$brickFile, ['data' => array_values($relQuest->getListviewData())]]; } } else if ($_type == AT_TYPE_TELEPORT) @@ -129,7 +129,7 @@ class AreaTriggerPage extends GenericPage $relZone = new ZoneList(array(['id', $this->subject->getField('teleportA')])); if (!$relZone->error) { - $this->lvTabs[] = ['zone', ['data' => array_values($relZone->getListviewData())]]; + $this->lvTabs[] = [ZoneList::$brickFile, ['data' => array_values($relZone->getListviewData())]]; } } else if ($_type == AT_TYPE_SCRIPT) @@ -137,7 +137,7 @@ class AreaTriggerPage extends GenericPage $relTrigger = new AreaTriggerList(array(['id', $this->typeId, '!'], ['name', $this->subject->getField('name')])); if (!$relTrigger->error) { - $this->lvTabs[] = ['areatrigger', ['data' => array_values($relTrigger->getListviewData()), 'name' => Util::ucFirst(Lang::game('areatrigger'))], 'areatrigger']; + $this->lvTabs[] = [AreaTriggerList::$brickFile, ['data' => array_values($relTrigger->getListviewData()), 'name' => Util::ucFirst(Lang::game('areatrigger'))], 'areatrigger']; } } } diff --git a/pages/areatriggers.php b/pages/areatriggers.php index f8b8441b..b10b91f1 100644 --- a/pages/areatriggers.php +++ b/pages/areatriggers.php @@ -66,7 +66,7 @@ class AreaTriggersPage extends GenericPage } - $this->lvTabs[] = ['areatrigger', $tabData, 'areatrigger']; + $this->lvTabs[] = [AreaTriggerList::$brickFile, $tabData, 'areatrigger']; } protected function generateTitle() diff --git a/pages/arenateam.php b/pages/arenateam.php index 61308d3d..a78beadf 100644 --- a/pages/arenateam.php +++ b/pages/arenateam.php @@ -120,7 +120,7 @@ class ArenaTeamPage extends GenericPage $member = new LocalProfileList(array(['atm.arenaTeamId', $this->subjectGUID])); if (!$member->error) { - $this->lvTabs[] = ['profile', array( + $this->lvTabs[] = [ProfileList::$brickFile, array( 'data' => array_values($member->getListviewData(PROFILEINFO_CHARACTER | PROFILEINFO_ARENA)), 'sort' => [-15], 'visibleCols' => ['race', 'classs', 'level', 'talents', 'gearscore', 'rating', 'wins', 'losses'], diff --git a/pages/arenateams.php b/pages/arenateams.php index 91d09e7b..12d3bf77 100644 --- a/pages/arenateams.php +++ b/pages/arenateams.php @@ -117,7 +117,7 @@ class ArenaTeamsPage extends GenericPage $tabData['_errors'] = 1; } - $this->lvTabs[] = ['profile', $tabData, 'membersCol']; + $this->lvTabs[] = [ArenaTeamList::$brickFile, $tabData, 'membersCol']; } protected function postCache() diff --git a/pages/class.php b/pages/class.php index 9c5f6276..57b03e78 100644 --- a/pages/class.php +++ b/pages/class.php @@ -135,7 +135,7 @@ class ClassPage extends GenericPage { $this->extendGlobalData($genSpells->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED)); - $this->lvTabs[] = ['spell', array( + $this->lvTabs[] = [SpellList::$brickFile, array( 'data' => array_values($genSpells->getListviewData()), 'id' => 'spells', 'name' => '$LANG.tab_spells', @@ -165,7 +165,7 @@ class ClassPage extends GenericPage if ($items->hasDiffFields(['requiredRace'])) $hiddenCols = ['side']; - $this->lvTabs[] = ['item', array( + $this->lvTabs[] = [ItemList::$brickFile, array( 'data' => array_values($items->getListviewData()), 'id' => 'items', 'name' => '$LANG.tab_items', @@ -189,7 +189,7 @@ class ClassPage extends GenericPage { $this->extendGlobalData($quests->getJSGlobals()); - $this->lvTabs[] = ['quest', array( + $this->lvTabs[] = [QuestList::$brickFile, array( 'data' => array_values($quests->getListviewData()), 'sort' => ['reqlevel', 'name'] )]; @@ -201,7 +201,7 @@ class ClassPage extends GenericPage { $this->extendGlobalData($sets->getJSGlobals(GLOBALINFO_SELF)); - $this->lvTabs[] = ['itemset', array( + $this->lvTabs[] = [ItemsetList::$brickFile, array( 'data' => array_values($sets->getListviewData()), 'note' => sprintf(Util::$filterResultString, '?itemsets&filter=cl='.$this->typeId), 'hiddenCols' => ['classes'], @@ -219,7 +219,7 @@ class ClassPage extends GenericPage $trainer = new CreatureList($conditions); if (!$trainer->error) { - $this->lvTabs[] = ['creature', array( + $this->lvTabs[] = [CreatureList::$brickFile, array( 'data' => array_values($trainer->getListviewData()), 'id' => 'trainers', 'name' => '$LANG.tab_trainers' @@ -229,7 +229,7 @@ class ClassPage extends GenericPage // Tab: Races $races = new CharRaceList(array(['classMask', $_mask, '&'])); if (!$races->error) - $this->lvTabs[] = ['race', ['data' => array_values($races->getListviewData())]]; + $this->lvTabs[] = [CharRaceList::$brickFile, ['data' => array_values($races->getListviewData())]]; } } diff --git a/pages/classes.php b/pages/classes.php index 7a068afa..ba6d6b83 100644 --- a/pages/classes.php +++ b/pages/classes.php @@ -27,7 +27,7 @@ class ClassesPage extends GenericPage { $classes = new CharClassList(); if (!$classes->error) - $this->lvTabs[] = ['class', ['data' => array_values($classes->getListviewData())]]; + $this->lvTabs[] = [CharClassList::$brickFile, ['data' => array_values($classes->getListviewData())]]; } protected function generateTitle() diff --git a/pages/currencies.php b/pages/currencies.php index a5f8cf55..4186feab 100644 --- a/pages/currencies.php +++ b/pages/currencies.php @@ -37,7 +37,7 @@ class CurrenciesPage extends GenericPage $conditions[] = ['category', (int)$this->category[0]]; $money = new CurrencyList($conditions); - $this->lvTabs[] = ['currency', ['data' => array_values($money->getListviewData())]]; + $this->lvTabs[] = [CurrencyList::$brickFile, ['data' => array_values($money->getListviewData())]]; } protected function generateTitle() diff --git a/pages/currency.php b/pages/currency.php index 4e8699be..a0525058 100644 --- a/pages/currency.php +++ b/pages/currency.php @@ -155,7 +155,7 @@ class CurrencyPage extends GenericPage ); } - $this->lvTabs[] = ['creature', array( + $this->lvTabs[] = [CreatureList::$brickFile, array( 'data' => array_values($sbData), 'name' => '$LANG.tab_soldby', 'id' => 'sold-by-npc', @@ -183,7 +183,7 @@ class CurrencyPage extends GenericPage if ($createdBy->hasSetFields(['reagent1'])) $tabData['visibleCols'] = ['reagents']; - $this->lvTabs[] = ['spell', $tabData]; + $this->lvTabs[] = [SpellList::$brickFile, $tabData]; } } @@ -221,7 +221,7 @@ class CurrencyPage extends GenericPage if ($boughtBy->getMatches() > CFG_SQL_LIMIT_DEFAULT) $tabData['note'] = sprintf(Util::$filterResultString, $n); - $this->lvTabs[] = ['item', $tabData]; + $this->lvTabs[] = [ItemList::$brickFile, $tabData]; $this->extendGlobalData($boughtBy->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED)); } diff --git a/pages/emote.php b/pages/emote.php index 3405447a..38899386 100644 --- a/pages/emote.php +++ b/pages/emote.php @@ -154,7 +154,7 @@ class EmotePage extends GenericPage ); $acv = new AchievementList($condition); - $this->lvTabs[] = ['achievement', ['data' => array_values($acv->getListviewData())]]; + $this->lvTabs[] = [AchievementList::$brickFile, ['data' => array_values($acv->getListviewData())]]; $this->extendGlobalData($acv->getJsGlobals()); @@ -172,7 +172,7 @@ class EmotePage extends GenericPage $d['gender'] = $em[$id]['gender']; } - $this->lvTabs[] = ['sound', array( + $this->lvTabs[] = [SoundList::$brickFile, array( 'data' => array_values($data), // gender races 'extraCols' => ['$Listview.templates.title.columns[1]', '$Listview.templates.classs.columns[1]'] diff --git a/pages/emotes.php b/pages/emotes.php index bc930436..dc341ea2 100644 --- a/pages/emotes.php +++ b/pages/emotes.php @@ -34,7 +34,7 @@ class EmotesPage extends GenericPage 'name' => Util::ucFirst(Lang::game('emotes')) ); - $this->lvTabs[] = ['emote', $tabData, 'emote']; + $this->lvTabs[] = [EmoteList::$brickFile, $tabData, 'emote']; } protected function generateTitle() diff --git a/pages/enchantment.php b/pages/enchantment.php index ffc57d99..b76579fb 100644 --- a/pages/enchantment.php +++ b/pages/enchantment.php @@ -180,7 +180,7 @@ class EnchantmentPage extends GenericPage $gemList = new ItemList(array(['gemEnchantmentId', $this->typeId])); if (!$gemList->error) { - $this->lvTabs[] = ['item', array( + $this->lvTabs[] = [ItemList::$brickFile, array( 'data' => array_values($gemList->getListviewData()), 'name' => '$LANG.tab_usedby + \' \' + LANG.gems', 'id' => 'used-by-gem', @@ -193,7 +193,7 @@ class EnchantmentPage extends GenericPage $socketsList = new ItemList(array(['socketBonus', $this->typeId])); if (!$socketsList->error) { - $this->lvTabs[] = ['item', array( + $this->lvTabs[] = [ItemList::$brickFile, array( 'data' => array_values($socketsList->getListviewData()), 'name' => '$LANG.tab_socketbonus', 'id' => 'used-by-socketbonus', @@ -229,7 +229,7 @@ class EnchantmentPage extends GenericPage $ubItems = new ItemList($conditions); if (!$ubItems->error) { - $this->lvTabs[] = ['item', array( + $this->lvTabs[] = [ItemList::$brickFile, array( 'data' => array_values($ubItems->getListviewData()), 'name' => '$LANG.tab_usedby + \' \' + LANG.types[3][0]', 'id' => 'used-by-item', @@ -262,7 +262,7 @@ class EnchantmentPage extends GenericPage } } - $this->lvTabs[] = ['spell', array( + $this->lvTabs[] = [SpellList::$brickFile, array( 'data' => array_values($spellData), 'name' => '$LANG.tab_usedby + \' \' + LANG.types[6][0]', 'id' => 'used-by-spell', @@ -296,7 +296,7 @@ class EnchantmentPage extends GenericPage $data[$iId]['name'] .= ' '.Util::localizedString($ire[$iet[abs($re)]['ench']], 'name'); } - $this->lvTabs[] = ['item', array( + $this->lvTabs[] = [ItemList::$brickFile, array( 'data' => array_values($data), 'id' => 'used-by-rand', 'name' => '$LANG.tab_usedby + \' \' + \''.Lang::item('_rndEnchants').'\'', diff --git a/pages/enchantments.php b/pages/enchantments.php index a5329d2d..d0a4e1c4 100644 --- a/pages/enchantments.php +++ b/pages/enchantments.php @@ -87,7 +87,7 @@ class EnchantmentsPage extends GenericPage if ($this->filterObj->error) $tabData['_errors'] = '$1'; - $this->lvTabs[] = ['enchantment', $tabData, 'enchantment']; + $this->lvTabs[] = [EnchantmentList::$brickFile, $tabData, 'enchantment']; } protected function generateTitle() diff --git a/pages/event.php b/pages/event.php index 0848f739..108efb94 100644 --- a/pages/event.php +++ b/pages/event.php @@ -121,7 +121,7 @@ class EventPage extends GenericPage if ($hasFilter) $tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=38;crs='.$this->hId.';crv=0'); - $this->lvTabs[] = ['creature', $tabData]; + $this->lvTabs[] = [CreatureList::$brickFile, $tabData]; } } @@ -140,7 +140,7 @@ class EventPage extends GenericPage if ($hasFilter) $tabData['note'] = sprintf(Util::$filterResultString, '?objects&filter=cr=16;crs='.$this->hId.';crv=0'); - $this->lvTabs[] = ['object', $tabData]; + $this->lvTabs[] = [GameObjectList::$brickFile, $tabData]; } } @@ -161,7 +161,7 @@ class EventPage extends GenericPage if ($hasFilter) $tabData['note'] = sprintf(Util::$filterResultString, '?achievements&filter=cr=11;crs='.$this->hId.';crv=0'); - $this->lvTabs[] = ['achievement', $tabData]; + $this->lvTabs[] = [AchievementList::$brickFile, $tabData]; } } @@ -184,7 +184,7 @@ class EventPage extends GenericPage if ($hasFilter) $tabData['note'] = sprintf(Util::$filterResultString, '?quests&filter=cr=33;crs='.$this->hId.';crv=0'); - $this->lvTabs[] = ['quest', $tabData]; + $this->lvTabs[] = [QuestList::$brickFile, $tabData]; $questItems = []; foreach (array_column($quests->rewards, Type::ITEM) as $arr) @@ -221,7 +221,7 @@ class EventPage extends GenericPage if ($hasFilter) $tabData['note'] = sprintf(Util::$filterResultString, '?items&filter=cr=160;crs='.$this->hId.';crv=0'); - $this->lvTabs[] = ['item', $tabData]; + $this->lvTabs[] = [ItemList::$brickFile, $tabData]; } } @@ -258,7 +258,7 @@ class EventPage extends GenericPage $relData = array_merge($relData, $d); } - $this->lvTabs[] = ['event', array( + $this->lvTabs[] = [WorldEventList::$brickFile, array( 'data' => array_values($relData), 'id' => 'see-also', 'name' => '$LANG.tab_seealso', diff --git a/pages/events.php b/pages/events.php index 02ea9f9c..4ca7c8f3 100644 --- a/pages/events.php +++ b/pages/events.php @@ -54,7 +54,7 @@ class EventsPage extends GenericPage $data = array_values($events->getListviewData()); - $this->lvTabs[] = ['event', ['data' => $data]]; + $this->lvTabs[] = [WorldEventList::$brickFile, ['data' => $data]]; if ($_ = array_values(array_filter($data, function($x) {return $x['category'] > 0;}))) { diff --git a/pages/faction.php b/pages/faction.php index 016f60fb..faf2b008 100644 --- a/pages/faction.php +++ b/pages/faction.php @@ -187,7 +187,7 @@ class FactionPage extends GenericPage 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']; + $this->lvTabs[] = [ItemList::$brickFile, $tabData, 'itemStandingCol']; } // tab: creatures with onKill reputation @@ -220,7 +220,7 @@ class FactionPage extends GenericPage 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']; + $this->lvTabs[] = [CreatureList::$brickFile, $tabData, 'npcRepCol']; } } } @@ -240,7 +240,7 @@ class FactionPage extends GenericPage 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]; + $this->lvTabs[] = [CreatureList::$brickFile, $tabData]; } } @@ -249,7 +249,7 @@ class FactionPage extends GenericPage { $objects = new GameObjectList(array(['faction', $_])); if (!$objects->error) - $this->lvTabs[] = ['object', ['data' => array_values($objects->getListviewData())]]; + $this->lvTabs[] = [GameObjectList::$brickFile, ['data' => array_values($objects->getListviewData())]]; } // tab: quests @@ -274,7 +274,7 @@ class FactionPage extends GenericPage 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']; + $this->lvTabs[] = [QuestList::$brickFile, $tabData, 'questRepCol']; } // tab: achievements @@ -287,7 +287,7 @@ class FactionPage extends GenericPage { $this->extendGlobalData($acvs->getJSGlobals(GLOBALINFO_ANY)); - $this->lvTabs[] = ['achievement', array( + $this->lvTabs[] = [AchievementList::$brickFile, array( 'data' => array_values($acvs->getListviewData()), 'id' => 'criteria-of', 'name' => '$LANG.tab_criteriaof', diff --git a/pages/factions.php b/pages/factions.php index cffd56a1..dd29c9f7 100644 --- a/pages/factions.php +++ b/pages/factions.php @@ -55,7 +55,7 @@ class FactionsPage extends GenericPage if (!$factions->error) $data = array_values($factions->getListviewData()); - $this->lvTabs[] = ['faction', ['data' => $data]]; + $this->lvTabs[] = [FactionList::$brickFile, ['data' => $data]]; } protected function generateTitle() diff --git a/pages/genericPage.class.php b/pages/genericPage.class.php index 36570463..ea26a60c 100644 --- a/pages/genericPage.class.php +++ b/pages/genericPage.class.php @@ -761,6 +761,9 @@ class GenericPage $this->addAnnouncements(); + if (isset($this->lvTabs)) + array_walk($this->lvTabs, function (&$x) { $x = array_pad($x, 3, null); }); + include('template/pages/'.$this->tpl.'.tpl.php'); die(); } diff --git a/pages/guild.php b/pages/guild.php index bb01ffbf..4fb56556 100644 --- a/pages/guild.php +++ b/pages/guild.php @@ -124,7 +124,7 @@ class GuildPage extends GenericPage $member = new LocalProfileList(array(['p.guild', $this->subjectGUID], CFG_SQL_LIMIT_NONE)); if (!$member->error) { - $this->lvTabs[] = ['profile', array( + $this->lvTabs[] = [ProfileList::$brickFile, array( 'data' => array_values($member->getListviewData(PROFILEINFO_CHARACTER | PROFILEINFO_ARENA)), 'sort' => [-15], 'visibleCols' => ['race', 'classs', 'level', 'talents', 'gearscore', 'achievementpoints', 'guildrank'], diff --git a/pages/guilds.php b/pages/guilds.php index 4906a6fa..0277ee6f 100644 --- a/pages/guilds.php +++ b/pages/guilds.php @@ -113,7 +113,7 @@ class GuildsPage extends GenericPage $tabData['_errors'] = 1; } - $this->lvTabs[] = ['profile', $tabData, 'membersCol']; + $this->lvTabs[] = [GuildList::$brickFile, $tabData, 'membersCol']; } protected function postCache() diff --git a/pages/icons.php b/pages/icons.php index 8b17f6bb..5e01d595 100644 --- a/pages/icons.php +++ b/pages/icons.php @@ -66,7 +66,7 @@ class IconsPage extends GenericPage if ($this->filterObj->error) $tabData['_errors'] = 1; - $this->lvTabs[] = ['icongallery', $tabData]; + $this->lvTabs[] = [IconList::$brickFile, $tabData]; } protected function generateTitle() diff --git a/pages/item.php b/pages/item.php index c0d1f248..a8298ed8 100644 --- a/pages/item.php +++ b/pages/item.php @@ -442,7 +442,7 @@ class ItemPage extends genericPage $this->extendGlobalIDs(Type::SPELL, $perfItem[$sId]['requiredSpecialization']); } - $this->lvTabs[] = ['spell', array( + $this->lvTabs[] = [SpellList::$brickFile, array( 'data' => array_values($lvData), 'name' => '$LANG.tab_createdby', 'id' => 'created-by', // should by exclusive with created-by from spell_loot @@ -529,7 +529,7 @@ class ItemPage extends genericPage if ($sf[6]) $tabData['visibleCols'] = array_unique($sf[6]); - $this->lvTabs[] = ['item', $tabData]; + $this->lvTabs[] = [ItemList::$brickFile, $tabData]; } } @@ -569,7 +569,7 @@ class ItemPage extends genericPage if (!$contains->hasSetFields(['slot'])) $hCols[] = 'slot'; - $this->lvTabs[] = ['item', array( + $this->lvTabs[] = [ItemList::$brickFile, array( 'data' => array_values($contains->getListviewData()), 'name' => '$LANG.tab_cancontain', 'id' => 'can-contain', @@ -586,7 +586,7 @@ class ItemPage extends genericPage { $this->extendGlobalData($contains->getJSGlobals(GLOBALINFO_SELF)); - $this->lvTabs[] = ['item', array( + $this->lvTabs[] = [ItemList::$brickFile, array( 'data' => array_values($contains->getListviewData()), 'name' => '$LANG.tab_canbeplacedin', 'id' => 'can-be-placed-in', @@ -616,7 +616,7 @@ class ItemPage extends genericPage if (!$criteriaOf->hasSetFields(['reward_loc0'])) $tabData['hiddenCols'] = ['rewards']; - $this->lvTabs[] = ['achievement', $tabData]; + $this->lvTabs[] = [AchievementList::$brickFile, $tabData]; } // tab: reagent for @@ -631,7 +631,7 @@ class ItemPage extends genericPage { $this->extendGlobalData($reagent->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED)); - $this->lvTabs[] = ['spell', array( + $this->lvTabs[] = [SpellList::$brickFile, array( 'data' => array_values($reagent->getListviewData()), 'name' => '$LANG.tab_reagentfor', 'id' => 'reagent-for', @@ -653,7 +653,7 @@ class ItemPage extends genericPage $lockedObj = new GameObjectList(array(['lockId', $lockIds])); if (!$lockedObj->error) { - $this->lvTabs[] = ['object', array( + $this->lvTabs[] = [GameObjectList::$brickFile, array( 'data' => array_values($lockedObj->getListviewData()), 'name' => '$LANG.tab_unlocks', 'id' => 'unlocks-object' @@ -666,7 +666,7 @@ class ItemPage extends genericPage { $this->extendGlobalData($lockedItm->getJSGlobals(GLOBALINFO_SELF)); - $this->lvTabs[] = ['item', array( + $this->lvTabs[] = [ItemList::$brickFile, array( 'data' => array_values($lockedItm->getListviewData()), 'name' => '$LANG.tab_unlocks', 'id' => 'unlocks-item' @@ -701,7 +701,7 @@ class ItemPage extends genericPage { $this->extendGlobalData($saItems->getJSGlobals(GLOBALINFO_SELF)); - $this->lvTabs[] = ['item', array( + $this->lvTabs[] = [ItemList::$brickFile, array( 'data' => array_values($saItems->getListviewData()), 'name' => '$LANG.tab_seealso', 'id' => 'see-also' @@ -716,7 +716,7 @@ class ItemPage extends genericPage { $this->extendGlobalData($starts->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_REWARDS)); - $this->lvTabs[] = ['quest', array( + $this->lvTabs[] = [QuestList::$brickFile, array( 'data' => array_values($starts->getListviewData()), 'name' => '$LANG.tab_starts', 'id' => 'starts-quest' @@ -735,7 +735,7 @@ class ItemPage extends genericPage { $this->extendGlobalData($objective->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_REWARDS)); - $this->lvTabs[] = ['quest', array( + $this->lvTabs[] = [QuestList::$brickFile, array( 'data' => array_values($objective->getListviewData()), 'name' => '$LANG.tab_objectiveof', 'id' => 'objective-of-quest' @@ -753,7 +753,7 @@ class ItemPage extends genericPage { $this->extendGlobalData($provided->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_REWARDS)); - $this->lvTabs[] = ['quest', array( + $this->lvTabs[] = [QuestList::$brickFile, array( 'data' => array_values($provided->getListviewData()), 'name' => '$LANG.tab_providedfor', 'id' => 'provided-for-quest' @@ -837,7 +837,7 @@ class ItemPage extends genericPage } - $this->lvTabs[] = ['creature', array( + $this->lvTabs[] = [CreatureList::$brickFile, array( 'data' => array_values($sbData), 'name' => '$LANG.tab_soldby', 'id' => 'sold-by-npc', @@ -885,7 +885,7 @@ class ItemPage extends genericPage if ($boughtBy->getMatches() > CFG_SQL_LIMIT_DEFAULT && $n) $tabData['note'] = sprintf(Util::$filterResultString, $n); - $this->lvTabs[] = ['item', $tabData]; + $this->lvTabs[] = [ItemList::$brickFile, $tabData]; $this->extendGlobalData($boughtBy->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED)); } @@ -924,7 +924,7 @@ class ItemPage extends genericPage if ($taughtSpells->hasSetFields(['reagent1'])) $visCols[] = 'reagents'; - $this->lvTabs[] = ['spell', array( + $this->lvTabs[] = [SpellList::$brickFile, array( 'data' => array_values($taughtSpells->getListviewData()), 'name' => '$LANG.tab_teaches', 'id' => 'teaches', @@ -971,7 +971,7 @@ class ItemPage extends genericPage $cdItems = new ItemList($conditions); if (!$cdItems->error) { - $this->lvTabs[] = ['item', array( + $this->lvTabs[] = [ItemList::$brickFile, array( 'data' => array_values($cdItems->getListviewData()), 'name' => '$LANG.tab_sharedcooldown', 'id' => 'shared-cooldown' @@ -1014,7 +1014,7 @@ class ItemPage extends genericPage if (!$sounds->error) { $this->extendGlobalData($sounds->getJSGlobals(GLOBALINFO_SELF)); - $this->lvTabs[] = ['sound', ['data' => array_values($sounds->getListviewData())]]; + $this->lvTabs[] = [SoundList::$brickFile, ['data' => array_values($sounds->getListviewData())]]; } } diff --git a/pages/items.php b/pages/items.php index b953557e..0521a372 100644 --- a/pages/items.php +++ b/pages/items.php @@ -418,7 +418,7 @@ class ItemsPage extends GenericPage $tabData['data'] = array_values($tabData['data']); - $this->lvTabs[] = ['item', $tabData]; + $this->lvTabs[] = [ItemList::$brickFile, $tabData]; } // reformat for use in template @@ -429,7 +429,7 @@ class ItemsPage extends GenericPage if (empty($this->lvTabs)) { $this->forceTabs = false; - $this->lvTabs[] = ['item', ['data' => []]]; + $this->lvTabs[] = [ItemList::$brickFile, ['data' => []]]; } } diff --git a/pages/itemset.php b/pages/itemset.php index bec8984b..5cdf7bb9 100644 --- a/pages/itemset.php +++ b/pages/itemset.php @@ -227,7 +227,7 @@ class ItemsetPage extends GenericPage if (!$relSets->hasDiffFields(['classMask'])) $tabData['hiddenCols'] = ['classes']; - $this->lvTabs[] = ['itemset', $tabData]; + $this->lvTabs[] = [ItemsetList::$brickFile, $tabData]; $this->extendGlobalData($relSets->getJSGlobals()); } diff --git a/pages/itemsets.php b/pages/itemsets.php index 4f8d9212..8fb74742 100644 --- a/pages/itemsets.php +++ b/pages/itemsets.php @@ -71,7 +71,7 @@ class ItemsetsPage extends GenericPage if ($this->filterObj->error) $tabData['_errors'] = 1; - $this->lvTabs[] = ['itemset', $tabData]; + $this->lvTabs[] = [ItemsetList::$brickFile, $tabData]; } protected function postCache() diff --git a/pages/mails.php b/pages/mails.php index 4a3e48f2..e7e11ac0 100644 --- a/pages/mails.php +++ b/pages/mails.php @@ -32,7 +32,7 @@ class MailsPage extends GenericPage $this->extendGlobalData($mails->getJsGlobals()); - $this->lvTabs[] = ['mail', $tabData, 'mail']; + $this->lvTabs[] = [MailList::$brickFile, $tabData, 'mail']; } protected function generateTitle() diff --git a/pages/npc.php b/pages/npc.php index e482f3fc..91b6c0cc 100644 --- a/pages/npc.php +++ b/pages/npc.php @@ -480,14 +480,14 @@ class NpcPage extends GenericPage } if ($normal) - $this->lvTabs[] = ['spell', array( + $this->lvTabs[] = [SpellList::$brickFile, array( 'data' => array_values($normal), 'name' => '$LANG.tab_abilities', 'id' => 'abilities' )]; if ($controled) - $this->lvTabs[] = ['spell', array( + $this->lvTabs[] = [SpellList::$brickFile, array( 'data' => array_values($controled), 'name' => '$LANG.tab_controlledabilities', 'id' => 'controlled-abilities' @@ -508,7 +508,7 @@ class NpcPage extends GenericPage { $this->extendGlobalData($sbSpell->getJSGlobals()); - $this->lvTabs[] = ['spell', array( + $this->lvTabs[] = [SpellList::$brickFile, array( 'data' => array_values($sbSpell->getListviewData()), 'name' => '$LANG.tab_summonedby', 'id' => 'summoned-by-spell' @@ -524,7 +524,7 @@ class NpcPage extends GenericPage { $this->extendGlobalData($sbNPC->getJSGlobals()); - $this->lvTabs[] = ['creature', array( + $this->lvTabs[] = [CreatureList::$brickFile, array( 'data' => array_values($sbNPC->getListviewData()), 'name' => '$LANG.tab_summonedby', 'id' => 'summoned-by-npc' @@ -540,7 +540,7 @@ class NpcPage extends GenericPage { $this->extendGlobalData($sbGO->getJSGlobals()); - $this->lvTabs[] = ['object', array( + $this->lvTabs[] = [GameObjectList::$brickFile, array( 'data' => array_values($sbGO->getListviewData()), 'name' => '$LANG.tab_summonedby', 'id' => 'summoned-by-object' @@ -618,7 +618,7 @@ class NpcPage extends GenericPage if ($extra) $tabData['extraCols'] = array_values($extra); - $this->lvTabs[] = ['spell', $tabData]; + $this->lvTabs[] = [SpellList::$brickFile, $tabData]; } } else @@ -657,7 +657,7 @@ class NpcPage extends GenericPage $row['condition'][0][$id.':'.$this->typeId] = $cndData[$id.':'.$this->typeId]; } - $this->lvTabs[] = ['item', array( + $this->lvTabs[] = [ItemList::$brickFile, array( 'data' => array_values($lvData), 'name' => '$LANG.tab_sells', 'id' => 'currency-for', @@ -750,7 +750,7 @@ class NpcPage extends GenericPage if ($sf[4]) $tabData['hiddenCols'] = $sf[4]; - $this->lvTabs[] = ['item', $tabData]; + $this->lvTabs[] = [ItemList::$brickFile, $tabData]; } } @@ -797,14 +797,14 @@ class NpcPage extends GenericPage } if ($_[0]) - $this->lvTabs[] = ['quest', array( + $this->lvTabs[] = [QuestList::$brickFile, array( 'data' => array_values($_[0]), 'name' => '$LANG.tab_starts', 'id' => 'starts' )]; if ($_[1]) - $this->lvTabs[] = ['quest', array( + $this->lvTabs[] = [QuestList::$brickFile, array( 'data' => array_values($_[1]), 'name' => '$LANG.tab_ends', 'id' => 'ends' @@ -825,7 +825,7 @@ class NpcPage extends GenericPage { $this->extendGlobalData($objectiveOf->getJSGlobals()); - $this->lvTabs[] = ['quest', array( + $this->lvTabs[] = [QuestList::$brickFile, array( 'data' => array_values($objectiveOf->getListviewData()), 'name' => '$LANG.tab_objectiveof', 'id' => 'objective-of' @@ -843,7 +843,7 @@ class NpcPage extends GenericPage { $this->extendGlobalData($crtOf->getJSGlobals()); - $this->lvTabs[] = ['achievement', array( + $this->lvTabs[] = [AchievementList::$brickFile, array( 'data' => array_values($crtOf->getListviewData()), 'name' => '$LANG.tab_criteriaof', 'id' => 'criteria-of' @@ -873,7 +873,7 @@ class NpcPage extends GenericPage if (User::isInGroup(U_GROUP_STAFF)) $tabData['extraCols'] = ["\$Listview.funcBox.createSimpleCol('seat', '".Lang::npc('seat')."', '10%', 'seat')"]; - $this->lvTabs[] = ['creature', $tabData]; + $this->lvTabs[] = [CreatureList::$brickFile, $tabData]; } } @@ -905,7 +905,7 @@ class NpcPage extends GenericPage $tabData['visibleCols'] = ['activity']; $this->extendGlobalData($sounds->getJSGlobals(GLOBALINFO_SELF)); - $this->lvTabs[] = ['sound', $tabData]; + $this->lvTabs[] = [SoundList::$brickFile, $tabData]; } } } diff --git a/pages/npcs.php b/pages/npcs.php index 8d50ade6..bdb35ecf 100644 --- a/pages/npcs.php +++ b/pages/npcs.php @@ -90,7 +90,7 @@ class NpcsPage extends GenericPage if ($this->filterObj->error) $tabData['_errors'] = 1; - $this->lvTabs[] = ['creature', $tabData]; + $this->lvTabs[] = [CreatureList::$brickFile, $tabData]; } protected function postCache() diff --git a/pages/object.php b/pages/object.php index cb66a47c..b25ef256 100644 --- a/pages/object.php +++ b/pages/object.php @@ -297,7 +297,7 @@ class ObjectPage extends GenericPage { $this->extendGlobalData($summons->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED)); - $this->lvTabs[] = ['spell', array( + $this->lvTabs[] = [SpellList::$brickFile, array( 'data' => array_values($summons->getListviewData()), 'id' => 'summoned-by', 'name' => '$LANG.tab_summonedby' @@ -316,7 +316,7 @@ class ObjectPage extends GenericPage foreach ($data as $relId => $d) $data[$relId]['trigger'] = array_search($relId, $_); - $this->lvTabs[] = ['spell', array( + $this->lvTabs[] = [SpellList::$brickFile, array( 'data' => array_values($data), 'id' => 'spells', 'name' => '$LANG.tab_spells', @@ -332,7 +332,7 @@ class ObjectPage extends GenericPage { $this->extendGlobalData($acvs->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED)); - $this->lvTabs[] = ['achievement', array( + $this->lvTabs[] = [AchievementList::$brickFile, array( 'data' => array_values($acvs->getListviewData()), 'id' => 'criteria-of', 'name' => '$LANG.tab_criteriaof' @@ -358,14 +358,14 @@ class ObjectPage extends GenericPage } if ($_[0]) - $this->lvTabs[] = ['quest', array( + $this->lvTabs[] = [QuestList::$brickFile, array( 'data' => array_values($_[0]), 'name' => '$LANG.tab_starts', 'id' => 'starts' )]; if ($_[1]) - $this->lvTabs[] = ['quest', array( + $this->lvTabs[] = [QuestList::$brickFile, array( 'data' => array_values($_[1]), 'name' => '$LANG.tab_ends', 'id' => 'ends' @@ -380,7 +380,7 @@ class ObjectPage extends GenericPage { $this->extendGlobalData($relQuest->getJSGlobals()); - $this->lvTabs[] = ['quest', array( + $this->lvTabs[] = [QuestList::$brickFile, array( 'data' => array_values($relQuest->getListviewData()), 'name' => '$LANG.tab_quests', 'id' => 'quests' @@ -427,7 +427,7 @@ class ObjectPage extends GenericPage if ($hiddenCols) $tabData['hiddenCols'] = $hiddenCols; - $this->lvTabs[] = ['item', $tabData]; + $this->lvTabs[] = [ItemList::$brickFile, $tabData]; } } @@ -476,7 +476,7 @@ class ObjectPage extends GenericPage $tabData['_truncated'] = 1; } - $this->lvTabs[] = ['spell', $tabData]; + $this->lvTabs[] = [SpellList::$brickFile, $tabData]; } } @@ -486,7 +486,7 @@ class ObjectPage extends GenericPage { $this->extendGlobalData($sameModel->getJSGlobals()); - $this->lvTabs[] = ['object', array( + $this->lvTabs[] = [GameObjectList::$brickFile, array( 'data' => array_values($sameModel->getListviewData()), 'name' => '$LANG.tab_samemodelas', 'id' => 'same-model-as' diff --git a/pages/objects.php b/pages/objects.php index f0d5e63f..04c50870 100644 --- a/pages/objects.php +++ b/pages/objects.php @@ -73,7 +73,7 @@ class ObjectsPage extends GenericPage $tabData['_errors'] = 1; } - $this->lvTabs[] = ['object', $tabData]; + $this->lvTabs[] = [GameObjectList::$brickFile, $tabData]; } protected function generateTitle() diff --git a/pages/pet.php b/pages/pet.php index 7d5a16fd..fbac9b9f 100644 --- a/pages/pet.php +++ b/pages/pet.php @@ -95,7 +95,7 @@ class PetPage extends GenericPage ); $tng = new CreatureList($condition); - $this->lvTabs[] = ['creature', array( + $this->lvTabs[] = [CreatureList::$brickFile, array( 'data' => array_values($tng->getListviewData(NPCINFO_TAMEABLE)), 'name' => '$LANG.tab_tameable', 'hiddenCols' => ['type'], @@ -117,7 +117,7 @@ class PetPage extends GenericPage $food = new ItemList(array(['i.subClass', [5, 8]], ['i.FoodType', $list], CFG_SQL_LIMIT_NONE)); $this->extendGlobalData($food->getJSGlobals()); - $this->lvTabs[] = ['item', array( + $this->lvTabs[] = [ItemList::$brickFile, array( 'data' => array_values($food->getListviewData()), 'name' => '$LANG.diet', 'hiddenCols' => ['source', 'slot', 'side'], @@ -151,7 +151,7 @@ class PetPage extends GenericPage $spells = new SpellList($conditions); $this->extendGlobalData($spells->getJSGlobals(GLOBALINFO_SELF)); - $this->lvTabs[] = ['spell', array( + $this->lvTabs[] = [SpellList::$brickFile, array( 'data' => array_values($spells->getListviewData()), 'name' => '$LANG.tab_abilities', 'visibleCols' => ['schools', 'level'], @@ -178,7 +178,7 @@ class PetPage extends GenericPage $talents = new SpellList($conditions); $this->extendGlobalData($talents->getJSGlobals(GLOBALINFO_SELF)); - $this->lvTabs[] = ['spell', array( + $this->lvTabs[] = [SpellList::$brickFile, array( 'data' => array_values($talents->getListviewData()), 'visibleCols' => ['tier', 'level'], 'name' => '$LANG.tab_talents', diff --git a/pages/pets.php b/pages/pets.php index db75efab..f6700d4b 100644 --- a/pages/pets.php +++ b/pages/pets.php @@ -51,7 +51,7 @@ class PetsPage extends GenericPage if (!$pets->hasDiffFields(['type'])) $data['hiddenCols'] = ['type']; }; - $this->lvTabs[] = ['pet', $data, 'petFoodCol']; + $this->lvTabs[] = [PetList::$brickFile, $data, 'petFoodCol']; } protected function generateTitle() diff --git a/pages/profiles.php b/pages/profiles.php index b45748dd..5e09e039 100644 --- a/pages/profiles.php +++ b/pages/profiles.php @@ -184,7 +184,7 @@ class ProfilesPage extends GenericPage $this->roster = 0; - $this->lvTabs[] = ['profile', $tabData]; + $this->lvTabs[] = [ProfileList::$brickFile, $tabData]; } protected function postCache() diff --git a/pages/quest.php b/pages/quest.php index d33e4894..1fd1402a 100644 --- a/pages/quest.php +++ b/pages/quest.php @@ -963,7 +963,7 @@ class QuestPage extends GenericPage if (!$seeAlso->error) { $this->extendGlobalData($seeAlso->getJSGlobals()); - $this->lvTabs[] = ['quest', array( + $this->lvTabs[] = [QuestList::$brickFile, array( 'data' => array_values($seeAlso->getListviewData()), 'name' => '$LANG.tab_seealso', 'id' => 'see-also' @@ -975,7 +975,7 @@ class QuestPage extends GenericPage if (!$criteriaOf->error) { $this->extendGlobalData($criteriaOf->getJSGlobals()); - $this->lvTabs[] = ['achievement', array( + $this->lvTabs[] = [AchievementList::$brickFile, array( 'data' => array_values($criteriaOf->getListviewData()), 'name' => '$LANG.tab_criteriaof', 'id' => 'criteria-of' @@ -990,7 +990,7 @@ class QuestPage extends GenericPage if (!$pooledQuests->error) { $this->extendGlobalData($pooledQuests->getJSGlobals()); - $this->lvTabs[] = ['quest', array( + $this->lvTabs[] = [QuestList::$brickFile, array( 'data' => array_values($pooledQuests->getListviewData()), 'name' => 'Quest Pool', 'id' => 'quest-pool', diff --git a/pages/quests.php b/pages/quests.php index 1319e6a8..3a1448de 100644 --- a/pages/quests.php +++ b/pages/quests.php @@ -86,7 +86,7 @@ class QuestsPage extends GenericPage if ($this->filterObj->error) $tabData['_errors'] = 1; - $this->lvTabs[] = ['quest', $tabData]; + $this->lvTabs[] = [QuestList::$brickFile, $tabData]; } protected function generateTitle() diff --git a/pages/race.php b/pages/race.php index cbaa1230..76151547 100644 --- a/pages/race.php +++ b/pages/race.php @@ -109,7 +109,7 @@ class RacePage extends GenericPage if (!$classes->error) { $this->extendGlobalData($classes->getJSGlobals()); - $this->lvTabs[] = ['class', ['data' => array_values($classes->getListviewData())]]; + $this->lvTabs[] = [CharClassList::$brickFile, ['data' => array_values($classes->getListviewData())]]; } // Tongues @@ -122,7 +122,7 @@ class RacePage extends GenericPage if (!$tongues->error) { $this->extendGlobalData($tongues->getJSGlobals()); - $this->lvTabs[] = ['spell', array( + $this->lvTabs[] = [SpellList::$brickFile, array( 'data' => array_values($tongues->getListviewData()), 'id' => 'languages', 'name' => '$LANG.tab_languages', @@ -140,7 +140,7 @@ class RacePage extends GenericPage if (!$racials->error) { $this->extendGlobalData($racials->getJSGlobals()); - $this->lvTabs[] = ['spell', array( + $this->lvTabs[] = [SpellList::$brickFile, array( 'data' => array_values($racials->getListviewData()), 'id' => 'racial-traits', 'name' => '$LANG.tab_racialtraits', @@ -159,7 +159,7 @@ class RacePage extends GenericPage if (!$quests->error) { $this->extendGlobalData($quests->getJSGlobals()); - $this->lvTabs[] = ['quest', ['data' => array_values($quests->getListviewData())]]; + $this->lvTabs[] = [QuestList::$brickFile, ['data' => array_values($quests->getListviewData())]]; } // Mounts @@ -176,7 +176,7 @@ class RacePage extends GenericPage if (!$mounts->error) { $this->extendGlobalData($mounts->getJSGlobals()); - $this->lvTabs[] = ['item', array( + $this->lvTabs[] = [ItemList::$brickFile, array( 'data' => array_values($mounts->getListviewData()), 'id' => 'mounts', 'name' => '$LANG.tab_mounts', @@ -195,7 +195,7 @@ class RacePage extends GenericPage foreach ($data as $id => &$d) $d['gender'] = $vo[$id]; - $this->lvTabs[] = ['sound', array( + $this->lvTabs[] = [SoundList::$brickFile, array( 'data' => array_values($data), 'extraCols' => ['$Listview.templates.title.columns[1]'] )]; diff --git a/pages/races.php b/pages/races.php index 76621a11..27f504f2 100644 --- a/pages/races.php +++ b/pages/races.php @@ -35,7 +35,7 @@ class RacesPage extends GenericPage if (!$races->error) $data = array_values($races->getListviewData()); - $this->lvTabs[] = ['race', ['data' => $data]]; + $this->lvTabs[] = [CharRaceList::$brickFile, ['data' => $data]]; } protected function generateTitle() diff --git a/pages/search.php b/pages/search.php index ca59f8c1..6d172344 100644 --- a/pages/search.php +++ b/pages/search.php @@ -177,7 +177,7 @@ class SearchPage extends GenericPage if ($this->searchMask & SEARCH_TYPE_REGULAR) { $foundTotal = 0; - foreach ($this->lvTabs as [$file, $tabData, , $osInfo]) + foreach ($this->lvTabs as [, $tabData]) $foundTotal += count($tabData['data']); if ($foundTotal == 1) // only one match -> redirect to find @@ -284,13 +284,13 @@ class SearchPage extends GenericPage $this->performSearch(); - foreach ($this->lvTabs as [ , , , $osInfo]) + foreach ($this->lvTabs as [, , , $osInfo]) $foundTotal += $osInfo[2]; if (!$foundTotal) return Util::toJSON([$this->search, []]); - foreach ($this->lvTabs as [ , $tabData, , $osInfo]) + foreach ($this->lvTabs as [, $tabData, , $osInfo]) { $max = max(1, intVal($limit * $osInfo[2] / $foundTotal)); $limit -= $max; @@ -392,7 +392,7 @@ class SearchPage extends GenericPage $result['_truncated'] = 1; } - return ['class', $result, null, $osInfo]; + return [CharClassList::$brickFile, $result, null, $osInfo]; } return false; @@ -418,7 +418,7 @@ class SearchPage extends GenericPage $result['_truncated'] = 1; } - return ['race', $result, null, $osInfo]; + return [CharRaceList::$brickFile, $result, null, $osInfo]; } return false; @@ -444,7 +444,7 @@ class SearchPage extends GenericPage $result['_truncated'] = 1; } - return ['title', $result, null, $osInfo]; + return [TitleList::$brickFile, $result, null, $osInfo]; } return false; @@ -477,7 +477,7 @@ class SearchPage extends GenericPage $result['_truncated'] = 1; } - return ['event', $result, null, $osInfo]; + return [WorldEventList::$brickFile, $result, null, $osInfo]; } return false; @@ -503,7 +503,7 @@ class SearchPage extends GenericPage $result['_truncated'] = 1; } - return ['currency', $result, null, $osInfo]; + return [CurrencyList::$brickFile, $result, null, $osInfo]; } return false; @@ -539,7 +539,7 @@ class SearchPage extends GenericPage else $result['note'] = '$$WH.sprintf(LANG.lvnote_filterresults, \'?itemsets&filter=na='.urlencode($this->search).'\')'; - return ['itemset', $result, null, $osInfo]; + return [ItemsetList::$brickFile, $result, null, $osInfo]; } return false; @@ -613,7 +613,7 @@ class SearchPage extends GenericPage else $result['note'] = '$$WH.sprintf(LANG.lvnote_filterresults, \'?items&filter=na='.urlencode($this->search).'\')'; - return ['item', $result, null, $osInfo]; + return [ItemList::$brickFile, $result, null, $osInfo]; } return false; @@ -680,7 +680,7 @@ class SearchPage extends GenericPage else $result['note'] = '$$WH.sprintf(LANG.lvnote_filterresults, \'?spells=7&filter=na='.urlencode($this->search).'\')'; - return ['spell', $result, null, $osInfo]; + return [SpellList::$brickFile, $result, null, $osInfo]; } return false; @@ -731,7 +731,7 @@ class SearchPage extends GenericPage else $result['note'] = '$$WH.sprintf(LANG.lvnote_filterresults, \'?spells=-2&filter=na='.urlencode($this->search).'\')'; - return ['spell', $result, null, $osInfo]; + return [SpellList::$brickFile, $result, null, $osInfo]; } return false; @@ -773,7 +773,7 @@ class SearchPage extends GenericPage else $result['note'] = '$$WH.sprintf(LANG.lvnote_filterresults, \'?spells=-13&filter=na='.urlencode($this->search).'\')'; - return ['spell', $result, null, $osInfo]; + return [SpellList::$brickFile, $result, null, $osInfo]; } return false; @@ -815,7 +815,7 @@ class SearchPage extends GenericPage else $result['note'] = '$$WH.sprintf(LANG.lvnote_filterresults, \'?spells=-11&filter=na='.urlencode($this->search).'\')'; - return ['spell', $result, null, $osInfo]; + return [SpellList::$brickFile, $result, null, $osInfo]; } return false; @@ -857,7 +857,7 @@ class SearchPage extends GenericPage else $result['note'] = '$$WH.sprintf(LANG.lvnote_filterresults, \'?spells=11&filter=na='.urlencode($this->search).'\')'; - return ['spell', $result, null, $osInfo]; + return [SpellList::$brickFile, $result, null, $osInfo]; } return false; @@ -899,7 +899,7 @@ class SearchPage extends GenericPage else $result['note'] = '$$WH.sprintf(LANG.lvnote_filterresults, \'?spells=-6&filter=na='.urlencode($this->search).'\')'; - return ['spell', $result, null, $osInfo]; + return [SpellList::$brickFile, $result, null, $osInfo]; } return false; @@ -940,7 +940,7 @@ class SearchPage extends GenericPage else $result['note'] = '$$WH.sprintf(LANG.lvnote_filterresults, \'?spells=-5&filter=na='.urlencode($this->search).'\')'; - return ['spell', $result, null, $osInfo]; + return [SpellList::$brickFile, $result, null, $osInfo]; } return false; @@ -975,7 +975,7 @@ class SearchPage extends GenericPage else $result['note'] = '$$WH.sprintf(LANG.lvnote_filterresults, \'?npcs&filter=na='.urlencode($this->search).'\')'; - return ['creature', $result, null, $osInfo]; + return [CreatureList::$brickFile, $result, null, $osInfo]; } return false; @@ -1008,7 +1008,7 @@ class SearchPage extends GenericPage else $result['note'] = '$$WH.sprintf(LANG.lvnote_filterresults, \'?quests&filter=na='.urlencode($this->search).'\')'; - return ['quest', $result, null, $osInfo]; + return [QuestList::$brickFile, $result, null, $osInfo]; } return false; @@ -1048,7 +1048,7 @@ class SearchPage extends GenericPage else $result['note'] = '$$WH.sprintf(LANG.lvnote_filterresults, \'?achievements&filter=na='.urlencode($this->search).'\')'; - return ['achievement', $result, null, $osInfo]; + return [AchievementList::$brickFile, $result, null, $osInfo]; } return false; @@ -1087,7 +1087,7 @@ class SearchPage extends GenericPage else $result['note'] = '$$WH.sprintf(LANG.lvnote_filterresults, \'?achievements=1&filter=na='.urlencode($this->search).'\')'; - return ['achievement', $result, null, $osInfo]; + return [AchievementList::$brickFile, $result, null, $osInfo]; } return false; @@ -1112,7 +1112,7 @@ class SearchPage extends GenericPage $result['_truncated'] = 1; } - return ['zone', $result, null, $osInfo]; + return [ZoneList::$brickFile, $result, null, $osInfo]; } return false; @@ -1142,7 +1142,7 @@ class SearchPage extends GenericPage else $result['note'] = '$$WH.sprintf(LANG.lvnote_filterresults, \'?objects&filter=na='.urlencode($this->search).'\')'; - return ['object', $result, null, $osInfo]; + return [GameObjectList::$brickFile, $result, null, $osInfo]; } return false; @@ -1164,7 +1164,7 @@ class SearchPage extends GenericPage $result['_truncated'] = 1; } - return ['faction', $result, null, $osInfo]; + return [FactionList::$brickFile, $result, null, $osInfo]; } return false; @@ -1190,7 +1190,7 @@ class SearchPage extends GenericPage $result['_truncated'] = 1; } - return ['skill', $result, null, $osInfo]; + return [SkillList::$brickFile, $result, null, $osInfo]; } return false; @@ -1219,7 +1219,7 @@ class SearchPage extends GenericPage $result['_truncated'] = 1; } - return ['pet', $result, 'petFoodCol', $osInfo]; + return [PetList::$brickFile, $result, 'petFoodCol', $osInfo]; } return false; @@ -1262,7 +1262,7 @@ class SearchPage extends GenericPage else $result['note'] = '$$WH.sprintf(LANG.lvnote_filterresults, \'?spells=-8&filter=na='.urlencode($this->search).'\')'; - return ['spell', $result, null, $osInfo]; + return [SpellList::$brickFile, $result, null, $osInfo]; } return false; @@ -1310,7 +1310,7 @@ class SearchPage extends GenericPage else $result['note'] = '$$WH.sprintf(LANG.lvnote_filterresults, \'?spells=0&filter=na='.urlencode($this->search).'\')'; - return ['spell', $result, null, $osInfo]; + return [SpellList::$brickFile, $result, null, $osInfo]; } return false; @@ -1329,7 +1329,7 @@ class SearchPage extends GenericPage 'name' => Util::ucFirst(Lang::game('emotes')) ); - return ['emote', $result, 'emote', $osInfo]; + return [EmoteList::$brickFile, $result, 'emote', $osInfo]; } return false; @@ -1362,7 +1362,7 @@ class SearchPage extends GenericPage $result['_truncated'] = 1; } - return ['enchantment', $result, 'enchantment', $osInfo]; + return [EnchantmentList::$brickFile, $result, 'enchantment', $osInfo]; } return false; @@ -1387,7 +1387,7 @@ class SearchPage extends GenericPage $result['_truncated'] = 1; } - return ['sound', $result, null, $osInfo]; + return [SoundList::$brickFile, $result, null, $osInfo]; } return false; diff --git a/pages/skill.php b/pages/skill.php index 17f5113b..21c5e030 100644 --- a/pages/skill.php +++ b/pages/skill.php @@ -90,7 +90,7 @@ class SkillPage extends GenericPage { $this->extendGlobalData($recipes->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED)); - $this->lvTabs[] = ['spell', array( + $this->lvTabs[] = [SpellList::$brickFile, array( 'data' => array_values($recipes->getListviewData()), 'id' => 'recipes', 'name' => '$LANG.tab_recipes', @@ -121,7 +121,7 @@ class SkillPage extends GenericPage if ($_ = array_search($this->typeId, $filterRecipe)) $tabData['note'] = sprintf(Util::$filterResultString, "?items=9.".$_); - $this->lvTabs[] = ['item', $tabData]; + $this->lvTabs[] = [ItemList::$brickFile, $tabData]; } // tab: crafted items [items] @@ -148,7 +148,7 @@ class SkillPage extends GenericPage if ($_ = array_search($this->typeId, $filterItem)) $tabData['note'] = sprintf(Util::$filterResultString, "?items&filter=cr=86;crs=".$_.";crv=0"); - $this->lvTabs[] = ['item', $tabData]; + $this->lvTabs[] = [ItemList::$brickFile, $tabData]; } } @@ -173,7 +173,7 @@ class SkillPage extends GenericPage if ($_ = array_search($this->typeId, $filterItem)) $tabData['note'] = sprintf(Util::$filterResultString, "?items&filter=99:168;crs=".$_.":2;crv=0:0"); - $this->lvTabs[] = ['item', $tabData]; + $this->lvTabs[] = [ItemList::$brickFile, $tabData]; } // tab: required by [itemset] @@ -187,7 +187,7 @@ class SkillPage extends GenericPage { $this->extendGlobalData($reqBy->getJSGlobals(GLOBALINFO_SELF)); - $this->lvTabs[] = ['itemset', array( + $this->lvTabs[] = [ItemsetList::$brickFile, array( 'data' => array_values($reqBy->getListviewData()), 'id' => 'required-by-set', 'name' => '$LANG.tab_requiredby' @@ -243,7 +243,7 @@ class SkillPage extends GenericPage break; } - $this->lvTabs[] = ['spell', $tabData]; + $this->lvTabs[] = [SpellList::$brickFile, $tabData]; } // tab: trainers [npcs] @@ -272,7 +272,7 @@ class SkillPage extends GenericPage { $this->extendGlobalData($trainer->getJSGlobals()); - $this->lvTabs[] = ['creature', array( + $this->lvTabs[] = [CreatureList::$brickFile, array( 'data' => array_values($trainer->getListviewData()), 'id' => 'trainer', 'name' => '$LANG.tab_trainers', @@ -287,17 +287,17 @@ class SkillPage extends GenericPage $sort = 0; switch ($this->typeId) { - case 182: $sort = 24; break; // Herbalism - case 356: $sort = 101; break; // Fishing - case 164: $sort = 121; break; // Blacksmithing - case 171: $sort = 181; break; // Alchemy - case 165: $sort = 182; break; // Leatherworking - case 202: $sort = 201; break; // Engineering - case 197: $sort = 264; break; // Tailoring - case 185: $sort = 304; break; // Cooking - case 129: $sort = 324; break; // First Aid - case 773: $sort = 371; break; // Inscription - case 755: $sort = 373; break; // Jewelcrafting + case SKILL_HERBALISM: $sort = 24; break; + case SKILL_FISHING: $sort = 101; break; + case SKILL_BLACKSMITHING: $sort = 121; break; + case SKILL_ALCHEMY: $sort = 181; break; + case SKILL_LEATHERWORKING: $sort = 182; break; + case SKILL_ENGINEERING: $sort = 201; break; + case SKILL_TAILORING: $sort = 264; break; + case SKILL_COOKING: $sort = 304; break; + case SKILL_FIRST_AID: $sort = 324; break; + case SKILL_INSCRIPTION: $sort = 371; break; + case SKILL_JEWELCRAFTING: $sort = 373; break; } if ($sort) @@ -306,7 +306,7 @@ class SkillPage extends GenericPage if (!$quests->error) { $this->extendGlobalData($quests->getJSGlobals()); - $this->lvTabs[] = ['quest', ['data' => array_values($quests->getListviewData())]]; + $this->lvTabs[] = [QuestList::$brickFile, ['data' => array_values($quests->getListviewData())]]; } } } @@ -321,7 +321,7 @@ class SkillPage extends GenericPage { $classes = new CharClassList(array(['id', $class])); if (!$classes->error) - $this->lvTabs[] = ['class', ['data' => array_values($classes->getListviewData())]]; + $this->lvTabs[] = [CharClassList::$brickFile, ['data' => array_values($classes->getListviewData())]]; } // tab: related races (apply races from [spells]) @@ -334,7 +334,7 @@ class SkillPage extends GenericPage { $races = new CharRaceList(array(['id', $race])); if (!$races->error) - $this->lvTabs[] = ['race', ['data' => array_values($races->getListviewData())]]; + $this->lvTabs[] = [CharRaceList::$brickFile, ['data' => array_values($races->getListviewData())]]; } } } diff --git a/pages/skills.php b/pages/skills.php index d423a9f9..711c7fee 100644 --- a/pages/skills.php +++ b/pages/skills.php @@ -38,7 +38,7 @@ class SkillsPage extends GenericPage $skills = new SkillList($conditions); - $this->lvTabs[] = ['skill', ['data' => array_values($skills->getListviewData())]]; + $this->lvTabs[] = [SkillList::$brickFile, ['data' => array_values($skills->getListviewData())]]; } protected function generateTitle() diff --git a/pages/sound.php b/pages/sound.php index c3415a69..4cb0193c 100644 --- a/pages/sound.php +++ b/pages/sound.php @@ -160,12 +160,8 @@ class SoundPage extends GenericPage $spells = new SpellList($cnd); if (!$spells->error) { - $data = $spells->getListviewData(); $this->extendGlobalData($spells->getJSGlobals(GLOBALINFO_SELF)); - - $this->lvTabs[] = ['spell', array( - 'data' => array_values($data), - )]; + $this->lvTabs[] = [SpellList::$brickFile, ['data' => array_values($spells->getListviewData())]]; } @@ -198,7 +194,7 @@ class SoundPage extends GenericPage if (!$items->error) { $this->extendGlobalData($items->getJSGlobals(GLOBALINFO_SELF)); - $this->lvTabs[] = ['item', ['data' => array_values($items->getListviewData())]]; + $this->lvTabs[] = [ItemList::$brickFile, ['data' => array_values($items->getListviewData())]]; } } @@ -256,7 +252,7 @@ class SoundPage extends GenericPage $tabData['data'] = array_values($zoneData); $tabData['hiddenCols'] = ['territory']; - $this->lvTabs[] = ['zone', $tabData]; + $this->lvTabs[] = [ZoneList::$brickFile, $tabData]; } } @@ -268,7 +264,7 @@ class SoundPage extends GenericPage if (!$races->error) { $this->extendGlobalData($races->getJSGlobals(GLOBALINFO_SELF)); - $this->lvTabs[] = ['race', ['data' => array_values($races->getListviewData())]]; + $this->lvTabs[] = [CharRaceList::$brickFile, ['data' => array_values($races->getListviewData())]]; } } @@ -280,7 +276,7 @@ class SoundPage extends GenericPage if (!$races->error) { $this->extendGlobalData($races->getJSGlobals(GLOBALINFO_SELF)); - $this->lvTabs[] = ['emote', array( + $this->lvTabs[] = [EmoteList::$brickFile, array( 'data' => array_values($races->getListviewData()), 'name' => Util::ucFirst(Lang::game('emotes')) ), 'emote']; @@ -350,7 +346,7 @@ class SoundPage extends GenericPage $this->addScript([SC_JS_FILE, '?data=zones']); $this->extendGlobalData($npcs->getJSGlobals(GLOBALINFO_SELF)); - $this->lvTabs[] = ['creature', ['data' => array_values($npcs->getListviewData())]]; + $this->lvTabs[] = [CreatureList::$brickFile, ['data' => array_values($npcs->getListviewData())]]; } } } diff --git a/pages/sounds.php b/pages/sounds.php index 632000bb..b9377d05 100644 --- a/pages/sounds.php +++ b/pages/sounds.php @@ -63,7 +63,7 @@ class SoundsPage extends GenericPage if ($this->filterObj->error) $tabData['_errors'] = 1; } - $this->lvTabs[] = ['sound', $tabData]; + $this->lvTabs[] = [SoundList::$brickFile, $tabData]; } protected function postCache() diff --git a/pages/spell.php b/pages/spell.php index d0f6263c..41de20f8 100644 --- a/pages/spell.php +++ b/pages/spell.php @@ -352,7 +352,7 @@ class SpellPage extends GenericPage if (!$abilities->hasSetFields(['skillLines'])) $tabData['hiddenCols'] = ['skill']; - $this->lvTabs[] = ['spell', $tabData]; + $this->lvTabs[] = [SpellList::$brickFile, $tabData]; $this->extendGlobalData($abilities->getJSGlobals(GLOBALINFO_SELF)); } @@ -399,7 +399,7 @@ class SpellPage extends GenericPage if (!$modSpells->hasSetFields(['skillLines'])) $tabData['hiddenCols'] = ['skill']; - $this->lvTabs[] = ['spell', $tabData]; + $this->lvTabs[] = [SpellList::$brickFile, $tabData]; $this->extendGlobalData($modSpells->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED)); } @@ -448,7 +448,7 @@ class SpellPage extends GenericPage if (!$modsSpell->hasSetFields(['skillLines'])) $tabData['hiddenCols'] = ['skill']; - $this->lvTabs[] = ['spell', $tabData]; + $this->lvTabs[] = [SpellList::$brickFile, $tabData]; $this->extendGlobalData($modsSpell->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED)); } @@ -513,7 +513,7 @@ class SpellPage extends GenericPage if (isset($saE)) $tabData['extraCols'] = $saE; - $this->lvTabs[] = ['spell', $tabData]; + $this->lvTabs[] = [SpellList::$brickFile, $tabData]; $this->extendGlobalData($saSpells->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED)); } @@ -534,7 +534,7 @@ class SpellPage extends GenericPage $cdSpells = new SpellList($conditions); if (!$cdSpells->error) { - $this->lvTabs[] = ['spell', array( + $this->lvTabs[] = [SpellList::$brickFile, array( 'data' => array_values($cdSpells->getListviewData()), 'name' => '$LANG.tab_sharedcooldown', 'id' => 'shared-cooldown' @@ -556,7 +556,7 @@ class SpellPage extends GenericPage $ubSpells = new SpellList($conditions); if (!$ubSpells->error) { - $this->lvTabs[] = ['spell', array( + $this->lvTabs[] = [SpellList::$brickFile, array( 'data' => array_values($ubSpells->getListviewData()), 'id' => 'used-by-spell', 'name' => '$LANG.tab_usedby' @@ -577,7 +577,7 @@ class SpellPage extends GenericPage $ubSets = new ItemsetList($conditions); if (!$ubSets->error) { - $this->lvTabs[] = ['itemset', array( + $this->lvTabs[] = [ItemsetList::$brickFile, array( 'data' => array_values($ubSets->getListviewData()), 'id' => 'used-by-itemset', 'name' => '$LANG.tab_usedby' @@ -599,7 +599,7 @@ class SpellPage extends GenericPage $ubItems = new ItemList($conditions); if (!$ubItems->error) { - $this->lvTabs[] = ['item', array( + $this->lvTabs[] = [ItemList::$brickFile, array( 'data' => array_values($ubItems->getListviewData()), 'id' => 'used-by-item', 'name' => '$LANG.tab_usedby' @@ -620,7 +620,7 @@ class SpellPage extends GenericPage $ubObjects = new GameObjectList($conditions); if (!$ubObjects->error) { - $this->lvTabs[] = ['object', array( + $this->lvTabs[] = [GameObjectList::$brickFile, array( 'data' => array_values($ubObjects->getListviewData()), 'id' => 'used-by-object', 'name' => '$LANG.tab_usedby' @@ -637,7 +637,7 @@ class SpellPage extends GenericPage $ubTriggers = new AreaTriggerList(array(['id', $ubSAI[Type::AREATRIGGER]])); if (!$ubTriggers->error) { - $this->lvTabs[] = ['areatrigger', array( + $this->lvTabs[] = [AreaTriggerList::$brickFile, array( 'data' => array_values($ubTriggers->getListviewData()), 'id' => 'used-by-areatrigger', 'name' => '$LANG.tab_usedby' @@ -656,7 +656,7 @@ class SpellPage extends GenericPage $coAchievemnts = new AchievementList($conditions); if (!$coAchievemnts->error) { - $this->lvTabs[] = ['achievement', array( + $this->lvTabs[] = [AchievementList::$brickFile, array( 'data' => array_values($coAchievemnts->getListviewData()), 'id' => 'criteria-of', 'name' => '$LANG.tab_criteriaof' @@ -699,7 +699,7 @@ class SpellPage extends GenericPage } } - $this->lvTabs[] = ['item', array( + $this->lvTabs[] = [ItemList::$brickFile, array( 'data' => array_values($lv), 'name' => '$LANG.tab_contains', 'id' => 'contains', @@ -767,7 +767,7 @@ class SpellPage extends GenericPage if (isset($sH)) $tabData['hiddenCols'] = $sH; - $this->lvTabs[] = ['spell', $tabData]; + $this->lvTabs[] = [SpellList::$brickFile, $tabData]; $this->extendGlobalData($stacks->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED)); } @@ -811,7 +811,7 @@ class SpellPage extends GenericPage } } - $this->lvTabs[] = ['spell', array( + $this->lvTabs[] = [SpellList::$brickFile, array( 'data' => array_values($data), 'id' => 'spell-link', 'name' => Lang::spell('linkedWith'), @@ -834,7 +834,7 @@ class SpellPage extends GenericPage $trigger = new SpellList($conditions); if (!$trigger->error) { - $this->lvTabs[] = ['spell', array( + $this->lvTabs[] = [SpellList::$brickFile, array( 'data' => array_values($trigger->getListviewData()), 'id' => 'triggered-by', 'name' => '$LANG.tab_triggeredby' @@ -858,7 +858,7 @@ class SpellPage extends GenericPage $ubCreature = new CreatureList($conditions); if (!$ubCreature->error) { - $this->lvTabs[] = ['creature', array( + $this->lvTabs[] = [CreatureList::$brickFile, array( 'data' => array_values($ubCreature->getListviewData()), 'id' => 'used-by-npc', 'name' => '$LANG.tab_usedby' @@ -1013,7 +1013,7 @@ class SpellPage extends GenericPage $tabData['hiddenCols'] = ['instancetype']; } - $this->lvTabs[] = ['zone', $tabData]; + $this->lvTabs[] = [ZoneList::$brickFile, $tabData]; } } @@ -1045,7 +1045,7 @@ class SpellPage extends GenericPage if (!$teaches->hasSetFields(['skillLines'])) $tabData['hiddenCols'] = ['skill']; - $this->lvTabs[] = ['spell', $tabData]; + $this->lvTabs[] = [SpellList::$brickFile, $tabData]; } } @@ -1073,7 +1073,7 @@ class SpellPage extends GenericPage if (!$tbTrainer->error) { $this->extendGlobalData($tbTrainer->getJSGlobals()); - $this->lvTabs[] = ['creature', array( + $this->lvTabs[] = [CreatureList::$brickFile, array( 'data' => array_values($tbTrainer->getListviewData()), 'id' => 'taught-by-npc', 'name' => '$LANG.tab_taughtby', @@ -1095,7 +1095,7 @@ class SpellPage extends GenericPage if (!$tbSpell->error) { $tbsData = $tbSpell->getListviewData(); - $this->lvTabs[] = ['spell', array( + $this->lvTabs[] = [SpellList::$brickFile, array( 'data' => array_values($tbsData), 'id' => 'taught-by-spell', 'name' => '$LANG.tab_taughtby' @@ -1118,7 +1118,7 @@ class SpellPage extends GenericPage $tbQuest = new QuestList($conditions); if (!$tbQuest->error) { - $this->lvTabs[] = ['quest', array( + $this->lvTabs[] = [QuestList::$brickFile, array( 'data' => array_values($tbQuest->getListviewData()), 'id' => 'reward-from-quest', 'name' => '$LANG.tab_rewardfrom' @@ -1140,7 +1140,7 @@ class SpellPage extends GenericPage $tbItem = new ItemList($conditions); if (!$tbItem->error) { - $this->lvTabs[] = ['item', array( + $this->lvTabs[] = [ItemList::$brickFile, array( 'data' => array_values($tbItem->getListviewData()), 'id' => 'taught-by-item', 'name' => '$LANG.tab_taughtby' @@ -1159,7 +1159,7 @@ class SpellPage extends GenericPage $enchList = new EnchantmentList($conditions); if (!$enchList->error) { - $this->lvTabs[] = ['enchantment', array( + $this->lvTabs[] = [EnchantmentList::$brickFile, array( 'data' => array_values($enchList->getListviewData()), 'name' => Util::ucFirst(Lang::game('enchantments')) ), 'enchantment']; @@ -1191,7 +1191,7 @@ class SpellPage extends GenericPage $tabData['visibleCols'] = ['activity']; $this->extendGlobalData($sounds->getJSGlobals(GLOBALINFO_SELF)); - $this->lvTabs[] = ['sound', $tabData]; + $this->lvTabs[] = [SoundList::$brickFile, $tabData]; } } diff --git a/pages/spells.php b/pages/spells.php index 89dc7bd5..4d024371 100644 --- a/pages/spells.php +++ b/pages/spells.php @@ -463,7 +463,7 @@ class SpellsPage extends GenericPage if ($hiddenCols) $tabData['hiddenCols'] = array_unique($hiddenCols); - $this->lvTabs[] = ['spell', $tabData]; + $this->lvTabs[] = [SpellList::$brickFile, $tabData]; } protected function postCache() diff --git a/pages/title.php b/pages/title.php index a363cc2d..ded6e026 100644 --- a/pages/title.php +++ b/pages/title.php @@ -104,7 +104,7 @@ class TitlePage extends GenericPage { $this->extendGlobalData($quests->getJSGlobals(GLOBALINFO_REWARDS)); - $this->lvTabs[] = ['quest', array( + $this->lvTabs[] = [QuestList::$brickFile, array( 'data' => array_values($quests->getListviewData()), 'id' => 'reward-from-quest', 'name' => '$LANG.tab_rewardfrom', @@ -121,7 +121,7 @@ class TitlePage extends GenericPage { $this->extendGlobalData($acvs->getJSGlobals()); - $this->lvTabs[] = ['achievement', array( + $this->lvTabs[] = [AchievementList::$brickFile, array( 'data' => array_values($acvs->getListviewData()), 'id' => 'reward-from-achievement', 'name' => '$LANG.tab_rewardfrom', diff --git a/pages/titles.php b/pages/titles.php index fb0ce68f..46186460 100644 --- a/pages/titles.php +++ b/pages/titles.php @@ -49,7 +49,7 @@ class TitlesPage extends GenericPage $tabData['hiddenCols'] = ['source']; } - $this->lvTabs[] = ['title', $tabData]; + $this->lvTabs[] = [TitleList::$brickFile, $tabData]; } protected function generateTitle() diff --git a/pages/zone.php b/pages/zone.php index c1d4fd4f..dc64371f 100644 --- a/pages/zone.php +++ b/pages/zone.php @@ -523,7 +523,7 @@ class ZonePage extends GenericPage $this->extendGlobalData($creatureSpawns->getJSGlobals(GLOBALINFO_SELF)); - $this->lvTabs[] = ['creature', $tabData]; + $this->lvTabs[] = [CreatureList::$brickFile, $tabData]; } // tab: Objects @@ -539,7 +539,7 @@ class ZonePage extends GenericPage $this->extendGlobalData($objectSpawns->getJSGlobals(GLOBALINFO_SELF)); - $this->lvTabs[] = ['object', $tabData]; + $this->lvTabs[] = [GameObjectList::$brickFile, $tabData]; } $quests = new QuestList(array(['zoneOrSort', $this->typeId])); @@ -561,18 +561,18 @@ class ZonePage extends GenericPage // tab: Quests [including data collected by SOM-routine] if ($questsLV) { - $tabData = ['quest', ['data' => array_values($questsLV)]]; + $tabData = ['data' => array_values($questsLV)]; foreach (Game::$questClasses as $parent => $children) { if (!in_array($this->typeId, $children)) continue; - $tabData[1]['note'] = '$$WH.sprintf(LANG.lvnote_zonequests, '.$parent.', '.$this->typeId.',"'.$this->subject->getField('name', true).'", '.$this->typeId.')'; + $tabData['note'] = '$$WH.sprintf(LANG.lvnote_zonequests, '.$parent.', '.$this->typeId.',"'.$this->subject->getField('name', true).'", '.$this->typeId.')'; break; } - $this->lvTabs[] = $tabData; + $this->lvTabs[] = [QuestList::$brickFile, $tabData]; } // tab: item-quest starter @@ -591,7 +591,7 @@ class ZonePage extends GenericPage $qsiList = new ItemList(array(['id', array_keys($questStartItem)])); if (!$qsiList->error) { - $this->lvTabs[] = ['item', array( + $this->lvTabs[] = [ItemList::$brickFile, array( 'data' => array_values($qsiList->getListviewData()), 'name' => '$LANG.tab_startsquest', 'id' => 'starts-quest' @@ -607,7 +607,7 @@ class ZonePage extends GenericPage $rewards = new ItemList(array(['id', array_unique($rewardsLV)])); if (!$rewards->error) { - $this->lvTabs[] = ['item', array( + $this->lvTabs[] = [ItemList::$brickFile, array( 'data' => array_values($rewards->getListviewData()), 'name' => '$LANG.tab_questrewards', 'id' => 'quest-rewards', @@ -643,7 +643,7 @@ class ZonePage extends GenericPage if ($skill = DB::World()->selectCell('SELECT `skill` FROM skill_fishing_base_level WHERE `entry` = ?d', $this->typeId)) $note = ''.Lang::formatSkillBreakpoints(Game::getBreakpointsForSkill(SKILL_FISHING, $skill), Lang::FMT_HTML).''; - $this->lvTabs[] = ['item', array( + $this->lvTabs[] = [ItemList::$brickFile, array( 'data' => array_values($fish->getResult()), 'name' => '$LANG.tab_fishing', 'id' => 'fishing', @@ -750,7 +750,7 @@ class ZonePage extends GenericPage if ($extra) $tabData['extraCols'] = ['$Listview.extraCols.condition']; - $this->lvTabs[] = ['spell', $tabData]; + $this->lvTabs[] = [SpellList::$brickFile, $tabData]; } } @@ -758,7 +758,7 @@ class ZonePage extends GenericPage $subZones = new ZoneList(array(['parentArea', $this->typeId])); if (!$subZones->error) { - $this->lvTabs[] = ['zone', array( + $this->lvTabs[] = [ZoneList::$brickFile, array( 'data' => array_values($subZones->getListviewData()), 'name' => '$LANG.tab_zones', 'id' => 'subzones', @@ -816,7 +816,7 @@ class ZonePage extends GenericPage $tabData['data'] = array_values($data); - $this->lvTabs[] = ['sound', $tabData]; + $this->lvTabs[] = [SoundList::$brickFile, $tabData]; $this->extendGlobalData($music->getJSGlobals(GLOBALINFO_SELF)); diff --git a/pages/zones.php b/pages/zones.php index 9832eb63..97582b7a 100644 --- a/pages/zones.php +++ b/pages/zones.php @@ -83,7 +83,7 @@ class ZonesPage extends GenericPage $tabData['hiddenCols'] = $hiddenCols; $this->map = null; - $this->lvTabs[] = ['zone', $tabData]; + $this->lvTabs[] = [ZoneList::$brickFile, $tabData]; // create flight map if ($mapFile) diff --git a/template/bricks/lvTabs.tpl.php b/template/bricks/lvTabs.tpl.php index 2793bdda..a809af8a 100644 --- a/template/bricks/lvTabs.tpl.php +++ b/template/bricks/lvTabs.tpl.php @@ -12,12 +12,12 @@ if (!empty($this->lvTabs) || !empty($this->user['characterData']) || !empty($thi
lvTabs as $lv): - if ($lv[0]): + foreach ($this->lvTabs as [$tplName, $tabData]): + if ($tplName): continue; endif; - echo ''; + echo ''; endforeach; ?>