Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 27 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
OlzFilesParams | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||
OlzFiles | |
0.00% |
0 / 27 |
|
0.00% |
0 / 3 |
30 | |
0.00% |
0 / 1 |
getSearchTitle | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getSearchResults | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
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\OlzRootComponent; |
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 OlzRootComponent<array<string, mixed>> */ |
16 | class OlzFiles extends OlzRootComponent { |
17 | public function getSearchTitle(): string { |
18 | return 'TODO'; |
19 | } |
20 | |
21 | public function getSearchResults(array $terms): array { |
22 | return []; |
23 | } |
24 | |
25 | public function getHtml(mixed $args): string { |
26 | $this->httpUtils()->validateGetParams(OlzFilesParams::class); |
27 | $base_href = $this->envUtils()->getBaseHref(); |
28 | $code_href = $this->envUtils()->getCodeHref(); |
29 | |
30 | $user = $this->authUtils()->getCurrentUser(); |
31 | if (!$user) { |
32 | $this->httpUtils()->dieWithHttpError(401); |
33 | throw new \Exception('should already have failed'); |
34 | } |
35 | $user_root = $user->getRoot(); |
36 | if (!$user_root) { |
37 | $this->httpUtils()->dieWithHttpError(403); |
38 | throw new \Exception('should already have failed'); |
39 | } |
40 | |
41 | $out = OlzHeader::render([ |
42 | 'back_link' => "{$code_href}service/", |
43 | 'title' => "Dateien", |
44 | 'norobots' => true, |
45 | ]); |
46 | |
47 | $iframe_url = "{$base_href}/apps/files/artgris/?conf=default&tree=0"; |
48 | |
49 | $out .= <<<ZZZZZZZZZZ |
50 | <div class='content-full'> |
51 | <iframe class='files-iframe' src='{$iframe_url}'></iframe> |
52 | </div> |
53 | ZZZZZZZZZZ; |
54 | |
55 | $metadata = new Metadata(); |
56 | $out .= $metadata->getJsCssImports(); |
57 | |
58 | $out .= OlzFooter::render(); |
59 | |
60 | return $out; |
61 | } |
62 | } |