getCategoryFromUrl($pageParam); parent::__construct($pageCall, $pageParam); if ($pageCall == 'my-guides') { if (!User::isLoggedIn()) $this->error(); $this->name = Util::ucFirst(Lang::guide('myGuides')); $this->myGuides = true; } else $this->name = Util::ucFirst(Lang::game('guides')); } protected function generateContent() { $hCols = ['patch']; // pointless: display date instead $vCols = []; $xCols = ['$Listview.extraCols.date']; // ok if ($this->myGuides) { $conditions = [['userId', User::$id]]; $hCols[] = 'author'; $vCols[] = 'status'; } else { $conditions = array( ['locale', Lang::getLocale()->value], ['status', GUIDE_STATUS_ARCHIVED, '!'], // never archived guides [ 'OR', ['status', GUIDE_STATUS_APPROVED], // currently approved ['rev', 0, '>'] // has previously approved revision ] ); if (isset($this->category[0])) $conditions[] = ['category', $this->category]; } $data = []; $guides = new GuideList($conditions); if (!$guides->error) $data = array_values($guides->getListviewData()); $tabData = array( 'data' => $data, 'name' => Util::ucFirst(Lang::game('guides')), 'hiddenCols' => $hCols, 'visibleCols' => $vCols, 'extraCols' => $xCols ); $this->lvTabs[] = [GuideList::$brickFile, $tabData]; $this->redButtons = [BUTTON_GUIDE_NEW => User::canWriteGuide()]; } protected function generateTitle() { array_unshift($this->title, $this->name); if (isset($this->category[0])) array_unshift($this->title, Lang::guide('category', $this->category[0])); } protected function generatePath() { if (isset($this->category[0])) $this->path[] = $this->category[0]; } } ?>