Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 25 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
OlzFilesParams | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||
OlzFiles | |
0.00% |
0 / 25 |
|
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 1 |
getHtml | |
0.00% |
0 / 25 |
|
0.00% |
0 / 1 |
12 |
1 | <?php |
2 | |
3 | namespace Olz\Apps\Files\Components\OlzFiles; |
4 | |
5 | use Olz\Apps\Files\Metadata; |
6 | use Olz\Components\Common\OlzComponent; |
7 | use Olz\Components\Page\OlzFooter\OlzFooter; |
8 | use Olz\Components\Page\OlzHeader\OlzHeader; |
9 | use Olz\Utils\HttpParams; |
10 | |
11 | /** @extends HttpParams<array{}> */ |
12 | class OlzFilesParams extends HttpParams { |
13 | } |
14 | |
15 | /** @extends OlzComponent<array<string, mixed>> */ |
16 | class OlzFiles extends OlzComponent { |
17 | public function getHtml(mixed $args): string { |
18 | $this->httpUtils()->validateGetParams(OlzFilesParams::class); |
19 | $base_href = $this->envUtils()->getBaseHref(); |
20 | $code_href = $this->envUtils()->getCodeHref(); |
21 | |
22 | $user = $this->authUtils()->getCurrentUser(); |
23 | if (!$user) { |
24 | $this->httpUtils()->dieWithHttpError(401); |
25 | throw new \Exception('should already have failed'); |
26 | } |
27 | $user_root = $user->getRoot(); |
28 | if (!$user_root) { |
29 | $this->httpUtils()->dieWithHttpError(403); |
30 | throw new \Exception('should already have failed'); |
31 | } |
32 | |
33 | $out = OlzHeader::render([ |
34 | 'back_link' => "{$code_href}service/", |
35 | 'title' => "Dateien", |
36 | 'norobots' => true, |
37 | ]); |
38 | |
39 | $iframe_url = "{$base_href}/apps/files/artgris/?conf=default&tree=0"; |
40 | |
41 | $out .= <<<ZZZZZZZZZZ |
42 | <div class='content-full'> |
43 | <iframe class='files-iframe' src='{$iframe_url}'></iframe> |
44 | </div> |
45 | ZZZZZZZZZZ; |
46 | |
47 | $metadata = new Metadata(); |
48 | $out .= $metadata->getJsCssImports(); |
49 | |
50 | $out .= OlzFooter::render(); |
51 | |
52 | return $out; |
53 | } |
54 | } |