diff --git a/pages/faction.php b/endpoints/faction/faction.php similarity index 56% rename from pages/faction.php rename to endpoints/faction/faction.php index 83ffefb7..1279b62b 100644 --- a/pages/faction.php +++ b/endpoints/faction/faction.php @@ -6,55 +6,69 @@ if (!defined('AOWOW_REVISION')) die('illegal access'); -// menuId 7: Faction g_initPath() -// tabId 0: Database g_initHeader() -class FactionPage extends GenericPage +class FactionBaseResponse extends TemplateResponse implements ICache { - use TrDetailPage; + use TrDetailPage, TrCache; - protected $type = Type::FACTION; - protected $typeId = 0; - protected $tpl = 'detail-page-generic'; - protected $path = [0, 7]; - protected $tabId = 0; - protected $mode = CACHE_TYPE_PAGE; + protected int $cacheType = CACHE_TYPE_PAGE; - public function __construct($pageCall, $id) + protected string $template = 'detail-page-generic'; + protected string $pageName = 'faction'; + protected ?int $activeTab = parent::TAB_DATABASE; + protected array $breadcrumb = [0, 7]; + + public int $type = Type::FACTION; + public int $typeId = 0; + + private FactionList $subject; + + public function __construct(string $id) { - parent::__construct($pageCall, $id); + parent::__construct($id); - $this->typeId = intVal($id); - - $this->subject = new FactionList(array(['id', $this->typeId])); - if ($this->subject->error) - $this->notFound(Lang::game('faction'), Lang::faction('notFound')); - - $this->name = $this->subject->getField('name', true); + $this->typeId = intVal($id); + $this->contribute = Type::getClassAttrib($this->type, 'contribute') ?? CONTRIBUTE_NONE; } - protected function generatePath() + protected function generate() : void { + $this->subject = new FactionList(array(['id', $this->typeId])); + if ($this->subject->error) + $this->generateNotFound(Lang::game('faction'), Lang::faction('notFound')); + + $this->h1 = $this->subject->getField('name', true); + + $this->gPageInfo += array( + 'type' => $this->type, + 'typeId' => $this->typeId, + 'name' => $this->h1 + ); + + + /*************/ + /* Menu Path */ + /*************/ + + array_unshift($this->title, $this->h1, Util::ucFirst(Lang::game('faction'))); + + + /**************/ + /* Page Title */ + /**************/ + if ($foo = $this->subject->getField('cat')) { if ($bar = $this->subject->getField('cat2')) - $this->path[] = $bar; + $this->breadcrumb[] = $bar; - $this->path[] = $foo; + $this->breadcrumb[] = $foo; } - } - protected function generateTitle() - { - array_unshift($this->title, $this->subject->getField('name', true), Util::ucFirst(Lang::game('faction'))); - } - - protected function generateContent() - { - $this->addScript([SC_JS_FILE, '?data=zones']); /***********/ /* Infobox */ /***********/ + $infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags')); // Quartermaster if any @@ -62,7 +76,7 @@ class FactionPage extends GenericPage { $this->extendGlobalIds(Type::NPC, ...$ids); - $qmStr = Lang::faction('quartermaster').Lang::main('colon'); + $qmStr = Lang::faction('quartermaster'); if (count($ids) == 1) $qmStr .= '[npc='.$ids[0].']'; @@ -80,14 +94,16 @@ class FactionPage extends GenericPage // side if any if ($_ = $this->subject->getField('side')) - $infobox[] = Lang::main('side').Lang::main('colon').'[span class=icon-'.($_ == 1 ? 'alliance' : 'horde').']'.Lang::game('si', $_).'[/span]'; + $infobox[] = Lang::main('side').'[span class=icon-'.($_ == SIDE_ALLIANCE ? 'alliance' : 'horde').']'.Lang::game('si', $_).'[/span]'; + + if ($infobox) + $this->infobox = new InfoboxMarkup($infobox, ['allow' => Markup::CLASS_STAFF, 'dbpage' => true], 'infobox-contents0'); + /****************/ /* Main Content */ /****************/ - $this->extraText = ''; - $this->infobox = $infobox ? '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]' : null; $this->redButtons = array( BUTTON_WOWHEAD => true, BUTTON_LINKS => ['type' => $this->type, 'typeId' => $this->typeId] @@ -122,11 +138,14 @@ class FactionPage extends GenericPage $buff .= '[tr][td][faction='.$spillId.'][/td][td][span class=q'.($val > 0 ? '2]+' : '10]').$val.'%[/span][/td][td]'.Lang::game('rep', $spillover->getField('spilloverMaxRank')).'[/td][/tr]'; if ($buff) - $this->extraText .= '[h3 class=clear]'.Lang::faction('spillover').'[/h3][div margin=15px]'.Lang::faction('spilloverDesc').'[/div][table class=grid width=400px][tr][td width=150px][b]'.Util::ucFirst(Lang::game('faction')).'[/b][/td][td width=100px][b]'.Lang::spell('_value').'[/b][/td][td width=150px][b]'.Lang::faction('maxStanding').'[/b][/td][/tr]'.$buff.'[/table]'; - + $this->extraText = new Markup( + '[h3 class=clear]'.Lang::faction('spillover').'[/h3][div margin=15px]'.Lang::faction('spilloverDesc').'[/div][table class=grid width=400px][tr][td width=150px][b]'.Util::ucFirst(Lang::game('faction')).'[/b][/td][td width=100px][b]'.Lang::spell('_value').'[/b][/td][td width=150px][b]'.Lang::faction('maxStanding').'[/b][/td][/tr]'.$buff.'[/table]', + ['dbpage' => true, 'allow' => Markup::CLASS_ADMIN], + 'text-generic' + ); // reward rates (ultimately this should be calculated into each reward display) - if ($rates = DB::World()->selectRow('SELECT * FROM reputation_reward_rate WHERE faction = ?d', $this->typeId)) + if ($rates = DB::World()->selectRow('SELECT `quest_rate`, `quest_daily_rate`, `quest_weekly_rate`, `quest_monthly_rate`, `quest_repeatable_rate`, `creature_rate`, `spell_rate` FROM reputation_reward_rate WHERE `faction` = ?d', $this->typeId)) { $buff = ''; foreach ($rates as $k => $v) @@ -134,46 +153,48 @@ class FactionPage extends GenericPage if ($v == 1) continue; - switch ($k) + $head = match ($k) { - case 'quest_rate': $buff .= '[tr][td]'.Lang::game('quests') .Lang::main('colon').'[/td]'; break; - case 'quest_daily_rate': $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 'quest_repeatable_rate': $buff .= '[tr][td]'.Lang::game('quests').' ('.Lang::quest('repeatable').')'.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; - default: - continue 2; - } + 'quest_rate' => Lang::game('quests'), + 'quest_daily_rate' => Lang::game('quests').' ('.Lang::quest('daily').')', + 'quest_weekly_rate' => Lang::game('quests').' ('.Lang::quest('weekly').')', + 'quest_monthly_rate' => Lang::game('quests').' ('.Lang::quest('monthly').')', + 'quest_repeatable_rate' => Lang::game('quests').' ('.Lang::quest('repeatable').')', + 'creature_rate' => Lang::game('npcs'), + 'spell_rate' => Lang::game('spells') + }; - $buff .= '[td width=35px align=right][span class=q'.($v < 1 ? '10]' : '2]+').intVal(($v - 1) * 100).'%[/span][/td][/tr]'; + $buff .= '[tr][td]'.$head.Lang::main('colon').'[/td][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]'; + if ($buff && $this->extraText) + $this->extraText->append('[h3 class=clear]'.Lang::faction('customRewRate').'[/h3][table class=grid width=250px]'.$buff.'[/table]'); + else if ($buff) + $this->extraText = new Markup('[h3 class=clear]'.Lang::faction('customRewRate').'[/h3][table class=grid width=250px]'.$buff.'[/table]', ['dbpage' => true, 'allow' => Markup::CLASS_ADMIN], 'text-generic'); } // 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)) + 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'), + $this->transfer = Lang::faction('_transfer', array( $altFac->id, $altFac->getField('name', true), $pendant > 0 ? 'alliance' : 'horde', - $pendant > 0 ? Lang::game('si', 1) : Lang::game('si', 2) - ); + $pendant > 0 ? Lang::game('si', SIDE_ALLIANCE) : Lang::game('si', SIDE_HORDE) + )); } } + /**************/ /* Extra Tabs */ /**************/ + $this->lvTabs = new Tabs(['parent' => "\$\$WH.ge('tabs-generic')"], 'tabsRelated', true); + // tab: items $items = new ItemList(array(['requiredFaction', $this->typeId]), ['calcTotal' => true]); if (!$items->error) @@ -181,7 +202,7 @@ class FactionPage extends GenericPage $this->extendGlobalData($items->getJSGlobals(GLOBALINFO_SELF)); $tabData = array( - 'data' => array_values($items->getListviewData()), + 'data' => $items->getListviewData(), 'extraCols' => '$_', 'sort' => ['standing', 'name'] ); @@ -189,16 +210,17 @@ class FactionPage extends GenericPage if ($items->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) $tabData['note'] = sprintf(Util::$filterResultString, '?items&filter=cr=17;crs='.$this->typeId.';crv=0'); - $this->lvTabs[] = [ItemList::$brickFile, $tabData, 'itemStandingCol']; + $this->lvTabs->addListviewTab(new Listview($tabData, ItemList::$brickFile, 'itemStandingCol')); } // tab: creatures with onKill reputation - if ($this->subject->getField('reputationIndex') != -1) // only if you can actually gain reputation by kills + // only if you can actually gain reputation by kills + 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)}) + $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 @@ -214,7 +236,7 @@ class FactionPage extends GenericPage $d['reputation'] = $cRep[$id]; $tabData = array( - 'data' => array_values($data), + 'data' => $data, 'extraCols' => '$_', 'sort' => ['-reputation', 'name'] ); @@ -222,7 +244,8 @@ class FactionPage extends GenericPage if ($killCreatures->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) $tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=42;crs='.$this->typeId.';crv=0'); - $this->lvTabs[] = [CreatureList::$brickFile, $tabData, 'npcRepCol']; + $this->addDataLoader('zones'); + $this->lvTabs->addListviewTab(new Listview($tabData, CreatureList::$brickFile, 'npcRepCol')); } } } @@ -234,7 +257,7 @@ class FactionPage extends GenericPage if (!$members->error) { $tabData = array( - 'data' => array_values($members->getListviewData()), + 'data' => $members->getListviewData(), 'id' => 'member', 'name' => '$LANG.tab_members' ); @@ -242,7 +265,8 @@ class FactionPage extends GenericPage if ($members->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) $tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=3;crs='.$this->typeId.';crv=0'); - $this->lvTabs[] = [CreatureList::$brickFile, $tabData]; + $this->addDataLoader('zones'); + $this->lvTabs->addListviewTab(new Listview($tabData, CreatureList::$brickFile)); } } @@ -251,7 +275,10 @@ class FactionPage extends GenericPage { $objects = new GameObjectList(array(['faction', $_])); if (!$objects->error) - $this->lvTabs[] = [GameObjectList::$brickFile, ['data' => array_values($objects->getListviewData())]]; + { + $this->addDataLoader('zones'); + $this->lvTabs->addListviewTab(new Listview(['data' => $objects->getListviewData()], GameObjectList::$brickFile)); + } } // tab: quests @@ -269,14 +296,14 @@ class FactionPage extends GenericPage $this->extendGlobalData($quests->getJSGlobals(GLOBALINFO_ANY)); $tabData = array( - 'data' => array_values($quests->getListviewData($this->typeId)), + 'data' => $quests->getListviewData($this->typeId), 'extraCols' => '$_' ); if ($quests->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) $tabData['note'] = sprintf(Util::$filterResultString, '?quests&filter=cr=1;crs='.$this->typeId.';crv=0'); - $this->lvTabs[] = [QuestList::$brickFile, $tabData, 'questRepCol']; + $this->lvTabs->addListviewTab(new Listview($tabData, QuestList::$brickFile, 'questRepCol')); } // tab: achievements @@ -289,12 +316,12 @@ class FactionPage extends GenericPage { $this->extendGlobalData($acvs->getJSGlobals(GLOBALINFO_ANY)); - $this->lvTabs[] = [AchievementList::$brickFile, array( - 'data' => array_values($acvs->getListviewData()), + $this->lvTabs->addListviewTab(new Listview(array( + 'data' => $acvs->getListviewData(), 'id' => 'criteria-of', 'name' => '$LANG.tab_criteriaof', 'visibleCols' => ['category'] - )]; + ), AchievementList::$brickFile)); } // tab: condition-for @@ -303,8 +330,10 @@ class FactionPage extends GenericPage if ($tab = $cnd->toListviewTab('condition-for', '$LANG.tab_condition_for')) { $this->extendGlobalData($cnd->getJsGlobals()); - $this->lvTabs[] = $tab; + $this->lvTabs->addDataTab(...$tab); } + + parent::generate(); } } diff --git a/endpoints/factions/factions.php b/endpoints/factions/factions.php new file mode 100644 index 00000000..db3caeb6 --- /dev/null +++ b/endpoints/factions/factions.php @@ -0,0 +1,104 @@ + [469, 891, 67, 892, 169], + 980 => [936], + 1097 => [1037, 1052, 1117], + 0 => true + ); + + public function __construct(string $pageParam) + { + $this->getCategoryFromUrl($pageParam); + + parent::__construct($pageParam); + } + + protected function generate() : void + { + $this->h1 = Util::ucFirst(Lang::game('factions')); + + + /**************/ + /* Page Title */ + /**************/ + + array_unshift($this->title, $this->h1); + if ($this->category) + { + switch (count($this->category)) + { + case 1: + $t = Lang::faction('cat', $this->category[0]); + array_unshift($this->title, is_array($t) ? $t[0] : $t); + break; + case 2: + array_unshift($this->title, Lang::faction('cat', $this->category[0], $this->category[1])); + break; + } + } + + + /*************/ + /* Menu Path */ + /*************/ + + foreach ($this->category as $c) + $this->breadcrumb[] = $c; + + + /****************/ + /* Main Content */ + /****************/ + + $this->redButtons[BUTTON_WOWHEAD] = true; + + $conditions = []; + + if (!User::isInGroup(U_GROUP_EMPLOYEE)) // unlisted factions + $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; + + if (isset($this->category[1])) + $conditions[] = ['parentFactionId', $this->category[1]]; + else if (isset($this->category[0])) + { + if ($this->category[0]) + $subs = DB::Aowow()->selectCol('SELECT `id` FROM ?_factions WHERE `parentFactionId` = ?d', $this->category[0]); + else + $subs = [0]; + + $conditions[] = ['OR', ['parentFactionId', $subs], ['id', $subs]]; + } + + $data = []; + $factions = new FactionList($conditions); + if (!$factions->error) + $data = $factions->getListviewData(); + + $this->lvTabs = new Tabs(['parent' => "\$\$WH.ge('tabs-generic')"]); + + $this->lvTabs->addListviewTab(new Listview(['data' => $data], FactionList::$brickFile)); + + parent::generate(); + } +} + +?> diff --git a/localization/locale_dede.php b/localization/locale_dede.php index bb988ab3..dce05d01 100644 --- a/localization/locale_dede.php +++ b/localization/locale_dede.php @@ -1430,7 +1430,7 @@ $lang = array( 'spillover' => "Reputationsüberlauf", 'spilloverDesc' => "Für diese Fraktion erhaltener Ruf wird zusätzlich mit den unten aufgeführten Fraktionen anteilig verrechnet.", 'maxStanding' => "Max. Ruf", - 'quartermaster' => "Rüstmeister", + 'quartermaster' => "Rüstmeister: ", 'customRewRate' => "Abweichende Belohnungsraten", '_transfer' => 'Die Reputation mit dieser Fraktion wird mit dem für %s vertauscht, wenn Ihr zur %s wechselt.', 'cat' => array( diff --git a/localization/locale_enus.php b/localization/locale_enus.php index ce69f448..ee6d65f6 100644 --- a/localization/locale_enus.php +++ b/localization/locale_enus.php @@ -1430,7 +1430,7 @@ $lang = array( 'spillover' => "Reputation Spillover", 'spilloverDesc' => "Gaining reputation with this faction also yields a proportional gain with the factions listed below.", 'maxStanding' => "Max. Standing", - 'quartermaster' => "Quartermaster", + 'quartermaster' => "Quartermaster: ", 'customRewRate' => "Custom Reward Rate", '_transfer' => 'The reputation with this faction will be converted to %s if you transfer to %s.', 'cat' => array( diff --git a/localization/locale_eses.php b/localization/locale_eses.php index 1666804a..1b42e770 100644 --- a/localization/locale_eses.php +++ b/localization/locale_eses.php @@ -1430,7 +1430,7 @@ $lang = array( 'spillover' => "Excedente de reputación", 'spilloverDesc' => "Ganar reputación con esta facción tambien una proporción ganada con las facciones listadas a continuación.", 'maxStanding' => "Posición máxima", - 'quartermaster' => "Intendente", + 'quartermaster' => "Intendente: ", 'customRewRate' => "Radio de recompenza personalizado", '_transfer' => 'La reputación de esta facción sera convertida a %s Si te transfieres a %s.', 'cat' => array( diff --git a/localization/locale_frfr.php b/localization/locale_frfr.php index 1e49ae31..49b07e3b 100644 --- a/localization/locale_frfr.php +++ b/localization/locale_frfr.php @@ -1430,7 +1430,7 @@ $lang = array( 'spillover' => "Partage de réputations", 'spilloverDesc' => "Gagner de la réputation avec cette faction fourni une réputation proportionnelle avec les factions ci-dessous.", 'maxStanding' => "Niveau maximum", - 'quartermaster' => "Intendant", + 'quartermaster' => "Intendant : ", 'customRewRate' => "Taux de récompense personnalisé", '_transfer' => 'La réputation de cette faction sera convertie en %s si vous transférez vers %s.', 'cat' => array( diff --git a/localization/locale_ruru.php b/localization/locale_ruru.php index 592fc8d2..a9a9f7e8 100644 --- a/localization/locale_ruru.php +++ b/localization/locale_ruru.php @@ -1430,7 +1430,7 @@ $lang = array( 'spillover' => "Распространение репутации", 'spilloverDesc' => "Получение репутации у этой фракции также дает пропорциональный выигрыш по отношению к фракциям, перечисленным ниже.", 'maxStanding' => "Макс Уровень", - 'quartermaster' => "Интендант", + 'quartermaster' => "Интендант: ", 'customRewRate' => "Индивидуальная ставка вознаграждения", '_transfer' => 'Репутация у этой фракции будет преобразована в %s если вы перейдете в %s.', 'cat' => array( diff --git a/localization/locale_zhcn.php b/localization/locale_zhcn.php index 25d38247..514b70c2 100644 --- a/localization/locale_zhcn.php +++ b/localization/locale_zhcn.php @@ -1429,7 +1429,7 @@ $lang = array( 'spillover' => "声望额外效果", 'spilloverDesc' => "获得这个阵营的声望也将按比例获得下列阵营的声望。", 'maxStanding' => "最大关系", - 'quartermaster' => "军需官", + 'quartermaster' => "军需官:", 'customRewRate' => "自定义奖励率", '_transfer' => '这个阵营的声望将被转换到%s,如果你转移到%s。', 'cat' => array( diff --git a/pages/factions.php b/pages/factions.php deleted file mode 100644 index 3bba2906..00000000 --- a/pages/factions.php +++ /dev/null @@ -1,88 +0,0 @@ - [469, 891, 67, 892, 169], - 980 => [936], - 1097 => [1037, 1052, 1117], - 0 => true - ); - - public function __construct($pageCall, $pageParam) - { - $this->getCategoryFromUrl($pageParam); - - parent::__construct($pageCall, $pageParam); - - $this->name = Util::ucFirst(Lang::game('factions')); - } - - protected function generateContent() - { - $conditions = []; - - if (!User::isInGroup(U_GROUP_EMPLOYEE)) // unlisted factions - $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; - - if (isset($this->category[1])) - $conditions[] = ['parentFactionId', $this->category[1]]; - else if (isset($this->category[0])) - { - if ($this->category[0]) - $subs = DB::Aowow()->selectCol('SELECT id FROM ?_factions WHERE parentFactionId = ?d', $this->category[0]); - else - $subs = [0]; - - $conditions[] = ['OR', ['parentFactionId', $subs], ['id', $subs]]; - } - - $data = []; - $factions = new FactionList($conditions); - if (!$factions->error) - $data = array_values($factions->getListviewData()); - - $this->lvTabs[] = [FactionList::$brickFile, ['data' => $data]]; - } - - protected function generateTitle() - { - array_unshift($this->title, $this->name); - if ($this->category) - { - switch (count($this->category)) - { - case 1: - $t = Lang::faction('cat', $this->category[0]); - array_unshift($this->title, is_array($t) ? $t[0] : $t); - break; - case 2: - array_unshift($this->title, Lang::faction('cat', $this->category[0], $this->category[1])); - break; - } - } - } - - protected function generatePath() - { - foreach ($this->category as $c) - $this->path[] = $c; - } -} - -?>