page = $p[0]; if (isset($p[1])) $this->cat[] = $p[1]; if (count($params) > 1) for ($i = 1; $i < count($params); $i++) $this->cat[] = $params[$i]; $opts = ['parentCats' => $this->cat]; switch ($p[0]) { case 'achievements': $this->filter = (new AchievementListFilter(true, $opts)); break; case 'enchantments': $this->filter = (new EnchantmentListFilter(true, $opts)); break; case 'icons': $this->filter = (new IconListFilter(true, $opts)); break; case 'items': $this->filter = (new ItemListFilter(true, $opts)); break; case 'itemsets': $this->filter = (new ItemsetListFilter(true, $opts)); break; case 'npcs': $this->filter = (new CreatureListFilter(true, $opts)); break; case 'objects': $this->filter = (new GameObjectListFilter(true, $opts)); break; case 'quests': $this->filter = (new QuestListFilter(true, $opts)); break; case 'sounds': $this->filter = (new SoundListFilter(true, $opts)); break; case 'spells': $this->filter = (new SpellListFilter(true, $opts)); break; default: return; } parent::__construct($params); // always this one $this->handler = 'handleFilter'; } protected function handleFilter() { $url = '?'.$this->page; if ($this->cat) $url .= '='.implode('.', $this->cat); $fi = []; if ($x = $this->filter->getFilterString()) $url .= '&filter='.$x; if ($this->filter->error) $_SESSION['fiError'] = get_class($this->filter); if ($fi) $url .= '&filter='.implode(';', $fi); // do get request return $url; } }