['filter' => FILTER_VALIDATE_REGEXP, 'options' => ['regexp' => Filter::PATTERN_PARAM]] ); public function __construct(string $pageParam) { $this->getCategoryFromUrl($pageParam); parent::__construct($pageParam); $this->subCat = $pageParam !== '' ? '='.$pageParam : ''; $this->filter = new ItemsetListFilter($this->_get['filter'] ?? '', ['parentCats' => $this->category]); if ($this->filter->shouldReload) { $_SESSION['error']['fi'] = $this->filter::class; $get = $this->filter->buildGETParam(); $this->forward('?' . $this->pageName . $this->subCat . ($get ? '&filter=' . $get : '')); } $this->filterError = $this->filter->error; } protected function generate() : void { $this->h1 = Util::ucWords(Lang::game('itemsets')); $conditions = []; if (!User::isInGroup(U_GROUP_EMPLOYEE)) $conditions[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; if ($_ = $this->filter->getConditions()) $conditions[] = $_; /*************/ /* Menu Path */ /*************/ if ($cl = $this->filter->values['cl']) $this->breadcrumb[] = $cl; /**************/ /* Page Title */ /**************/ array_unshift($this->title, $this->h1); if ($cl = $this->filter->values['cl']) array_unshift($this->title, Lang::game('cl', $cl)); /****************/ /* Main Content */ /****************/ $this->redButtons[BUTTON_WOWHEAD] = true; if ($fiQuery = $this->filter->buildGETParam()) $this->wowheadLink .= '&filter='.$fiQuery; $itemsets = new ItemsetList($conditions, ['calcTotal' => true]); $this->extendGlobalData($itemsets->getJSGlobals()); $tabData = ['data' => $itemsets->getListviewData()]; if ($this->filter->fiExtraCols) $tabData['extraCols'] = '$fi_getExtraCols(fi_extraCols, 0, 0)'; // create note if search limit was exceeded if ($itemsets->getMatches() > Cfg::get('SQL_LIMIT_DEFAULT')) { $tabData['note'] = sprintf(Util::$tryFilteringString, 'LANG.lvnote_itemsetsfound', $itemsets->getMatches(), Cfg::get('SQL_LIMIT_DEFAULT')); $tabData['_truncated'] = 1; } $this->lvTabs = new Tabs(['parent' => "\$\$WH.ge('tabs-generic')"]); $this->lvTabs->addListviewTab(new Listview($tabData, ItemsetList::$brickFile)); parent::generate(); $this->setOnCacheLoaded([self::class, 'onBeforeDisplay']); } public static function onBeforeDisplay() : void { // sort for dropdown-menus Lang::sort('itemset', 'notes', SORT_NATURAL); Lang::sort('game', 'cl'); } } ?>