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

51 lines
1.3 KiB
PHP
Raw Normal View History

2020-02-10 00:52:25 +01:00
<?php
namespace Documents {
2020-04-03 15:56:04 +02:00
use Documents\Admin\AdminHead;
use Elements\Document;
2020-04-03 22:10:21 +02:00
use Objects\User;
2020-04-04 01:15:59 +02:00
use Views\Admin\AdminDashboardBody;
2020-07-02 00:47:45 +02:00
use Views\Admin\LoginBody;
2020-04-03 15:56:04 +02:00
class Admin extends Document {
2020-06-19 16:51:41 +02:00
public function __construct(User $user, ?string $view = NULL) {
2020-04-04 01:15:59 +02:00
$body = $user->isLoggedIn() ? AdminDashboardBody::class : LoginBody::class;
2020-06-19 16:51:41 +02:00
parent::__construct($user, AdminHead::class, $body, $view);
2020-02-10 00:52:25 +01:00
}
}
}
namespace Documents\Admin {
2020-04-03 15:56:04 +02:00
use Elements\Head;
class AdminHead extends Head {
2020-02-10 00:52:25 +01:00
public function __construct($document) {
parent::__construct($document);
}
protected function initSources() {
2020-06-14 22:35:01 +02:00
$this->loadFontawesome();
2020-02-10 00:52:25 +01:00
}
2021-04-02 21:58:06 +02:00
protected function initMetas(): array {
2020-02-10 00:52:25 +01:00
return array(
array('name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0'),
array('name' => 'format-detection', 'content' => 'telephone=yes'),
array('charset' => 'utf-8'),
array("http-equiv" => 'expires', 'content' => '0'),
array("name" => 'robots', 'content' => 'noarchive'),
);
}
2021-04-02 21:58:06 +02:00
protected function initRawFields(): array {
2020-02-10 00:52:25 +01:00
return array();
}
2021-04-02 21:58:06 +02:00
protected function initTitle(): string {
return $this->getSiteName() . " - Administration";
2020-02-10 00:52:25 +01:00
}
}
2020-04-03 15:56:04 +02:00
}