Files
aowow/endpoints/my-guides/my-guides.php
Sarjuuk fef27c58e6 Template/Update (Part 40)
* convert 'guides' (listing, viewing, writing & management)
 * don't allow comments on WIP guides
2025-09-25 15:58:56 +02:00

53 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 $pageParam)
{
parent::__construct($pageParam);
if (!User::isLoggedIn() || $pageParam)
$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();
}
}
?>