web-base/Core/Documents/Admin.class.php

18 lines
491 B
PHP
Raw Normal View History

2020-02-10 00:52:25 +01:00
<?php
2022-11-18 18:06:46 +01:00
namespace Core\Documents;
2020-04-03 15:56:04 +02:00
2022-11-18 18:06:46 +01:00
use Core\Elements\TemplateDocument;
use Core\Objects\Router\Router;
2020-04-03 15:56:04 +02:00
2021-12-08 16:53:43 +01:00
class Admin extends TemplateDocument {
2022-06-01 12:28:50 +02:00
public function __construct(Router $router) {
2022-06-20 19:52:31 +02:00
$user = $router->getContext()->getUser();
$template = $user ? "admin.twig" : "redirect.twig";
$params = $user ? [] : ["url" => "/login"];
2022-08-20 22:17:17 +02:00
$this->title = "Administration";
$this->searchable = false;
2022-06-01 12:28:50 +02:00
parent::__construct($router, $template, $params);
2021-12-08 16:53:43 +01:00
$this->enableCSP();
2020-02-10 00:52:25 +01:00
}
2020-04-03 15:56:04 +02:00
}