aowow/endpoints/my-guides/my-guides.php
Sarjuuk 715c1534eb Core/Endpoints
* don't use raw input to recreate subcategories for filter urls and
   external links
 * if a page does not expect categories it will now error out if it is
   called with parameters
 * fixed infite redirect loop that could occur if the pageName was an
   invalid string
 * added lost filter string for external page call to NPCs Page
2026-01-01 01:26:35 +01:00

52 lines
1.4 KiB
PHP

<?php
namespace Aowow;
if (!defined('AOWOW_REVISION'))
die('illegal access');
class MyguidesBaseResponse extends TemplateResponse
{
use TrListPage;
protected int $type = Type::GUIDE;
protected string $template = 'list-page-generic';
protected string $pageName = 'my-guides';
protected ?int $activeTab = parent::TAB_GUIDES;
// protected array $breadcrumb = [6]; // breadcrumb menu not displayed by WH.?
public function __construct(string $rawParam)
{
parent::__construct($rawParam);
if (!User::isLoggedIn() || $rawParam)
$this->generateError();
}
protected function generate() : void
{
$this->h1 = Util::ucFirst(Lang::guide('myGuides'));
array_unshift($this->title, $this->h1);
$this->redButtons = [BUTTON_GUIDE_NEW => User::canWriteGuide()];
$guides = new GuideList(array(['userId', User::$id]));
$this->lvTabs = new Tabs(['parent' => "\$\$WH.ge('tabs-generic')"]);
$this->lvTabs->addListviewTab(new Listview(array(
'data' => $guides->getListviewData(),
'name' => Util::ucFirst(Lang::game('guides')),
'hiddenCols' => ['patch', 'author'],
'visibleCols' => ['status'],
'extraCols' => ['$Listview.extraCols.date']
), GuideList::$brickFile));
parent::generate();
}
}
?>