From 465e019eaa0cbf1ec1b41b2b7c40f0240be97537 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Fri, 10 Oct 2025 22:28:20 +0200 Subject: [PATCH] FactionDetailPage/Tabs * only offer 'filter result' prompt on tabs for factions that are filtrable --- endpoints/faction/faction.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/endpoints/faction/faction.php b/endpoints/faction/faction.php index 934a191d..84ba340f 100644 --- a/endpoints/faction/faction.php +++ b/endpoints/faction/faction.php @@ -228,7 +228,8 @@ class FactionBaseResponse extends TemplateResponse implements ICache ); if ($items->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) - $tabData['note'] = sprintf(Util::$filterResultString, '?items&filter=cr=17;crs='.$this->typeId.';crv=0'); + if (!is_null(ItemListFilter::getCriteriaIndex(17, $this->typeId))) + $tabData['note'] = sprintf(Util::$filterResultString, '?items&filter=cr=17;crs='.$this->typeId.';crv=0'); $this->lvTabs->addListviewTab(new Listview($tabData, ItemList::$brickFile, 'itemStandingCol')); } @@ -262,7 +263,8 @@ class FactionBaseResponse extends TemplateResponse implements ICache ); if ($killCreatures->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) - $tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=42;crs='.$this->typeId.';crv=0'); + if (!is_null(CreatureListFilter::getCriteriaIndex(42, $this->typeId))) + $tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=42;crs='.$this->typeId.';crv=0'); $this->addDataLoader('zones'); $this->lvTabs->addListviewTab(new Listview($tabData, CreatureList::$brickFile, 'npcRepCol')); @@ -283,7 +285,8 @@ class FactionBaseResponse extends TemplateResponse implements ICache ); if ($members->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) - $tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=3;crs='.$this->typeId.';crv=0'); + if (!is_null(CreatureListFilter::getCriteriaIndex(3, $this->typeId))) + $tabData['note'] = sprintf(Util::$filterResultString, '?npcs&filter=cr=3;crs='.$this->typeId.';crv=0'); $this->addDataLoader('zones'); $this->lvTabs->addListviewTab(new Listview($tabData, CreatureList::$brickFile)); @@ -321,7 +324,8 @@ class FactionBaseResponse extends TemplateResponse implements ICache ); if ($quests->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) - $tabData['note'] = sprintf(Util::$filterResultString, '?quests&filter=cr=1;crs='.$this->typeId.';crv=0'); + if (!is_null(QuestListFilter::getCriteriaIndex(1, $this->typeId))) + $tabData['note'] = sprintf(Util::$filterResultString, '?quests&filter=cr=1;crs='.$this->typeId.';crv=0'); $this->lvTabs->addListviewTab(new Listview($tabData, QuestList::$brickFile, 'questRepCol')); }