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

66 lines
1.6 KiB
PHP
Raw Normal View History

2021-01-07 15:54:19 +01:00
<?php
namespace Documents {
use Documents\Files\FilesBody;
use Documents\Files\FilesHead;
use Elements\Document;
use Objects\User;
class Files extends Document {
public function __construct(User $user, string $view = NULL) {
parent::__construct($user, FilesHead::class, FilesBody::class, $view);
}
}
}
namespace Documents\Files {
use Elements\Head;
2021-03-31 20:30:51 +02:00
use Elements\Link;
2021-01-10 01:08:03 +01:00
use Elements\Script;
2021-01-07 15:54:19 +01:00
use Elements\SimpleBody;
class FilesHead extends Head {
protected function initSources() {
2021-03-31 20:30:51 +02:00
$this->addCSS(Link::BOOTSTRAP);
2021-01-07 15:54:19 +01:00
$this->loadFontawesome();
}
2021-04-02 21:58:06 +02:00
protected function initMetas(): array {
2021-01-07 15:54:19 +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'),
2021-03-29 23:10:35 +02:00
array('http-equiv' => 'expires', 'content' => '0'),
array('name' => 'robots', 'content' => 'noarchive'),
array('name' => 'referrer', 'content' => 'origin')
2021-01-07 15:54:19 +01:00
);
}
2021-04-02 21:58:06 +02:00
protected function initRawFields(): array {
2021-01-07 15:54:19 +01:00
return array();
}
2021-04-02 21:58:06 +02:00
protected function initTitle(): string {
2021-01-07 15:54:19 +01:00
return "File Control Panel";
}
}
class FilesBody extends SimpleBody {
public function __construct($document) {
parent::__construct($document);
}
2021-04-02 21:58:06 +02:00
protected function getContent(): string {
2021-01-07 15:54:19 +01:00
$html = "<noscript>" . $this->createErrorText("Javascript is required for this site to render.") . "</noscript>";
$html .= "<div id=\"root\"></div>";
2021-01-10 01:08:03 +01:00
$html .= new Script(Script::MIME_TEXT_JAVASCRIPT, Script::FILES);
2021-01-07 15:54:19 +01:00
return $html;
}
}
}