Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 17 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 1 |
| OlzStartseiteParams | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||
| OlzStartseite | |
0.00% |
0 / 17 |
|
0.00% |
0 / 4 |
42 | |
0.00% |
0 / 1 |
| hasAccess | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getSearchTitle | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getSearchResultsWhenHasAccess | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getHtmlWhenHasAccess | |
0.00% |
0 / 14 |
|
0.00% |
0 / 1 |
12 | |||
| 1 | <?php |
| 2 | |
| 3 | // ============================================================================= |
| 4 | // Zeigt die OLZ Startseite an. |
| 5 | // ============================================================================= |
| 6 | |
| 7 | namespace Olz\Startseite\Components\OlzStartseite; |
| 8 | |
| 9 | use Olz\Components\Common\OlzEditableText\OlzEditableText; |
| 10 | use Olz\Components\Common\OlzRootComponent; |
| 11 | use Olz\Components\Page\OlzFooter\OlzFooter; |
| 12 | use Olz\Components\Page\OlzHeader\OlzHeader; |
| 13 | use Olz\Startseite\Components\OlzCustomizableHome\OlzCustomizableHome; |
| 14 | use Olz\Utils\HttpParams; |
| 15 | |
| 16 | /** @extends HttpParams<array{}> */ |
| 17 | class OlzStartseiteParams extends HttpParams { |
| 18 | } |
| 19 | |
| 20 | /** @extends OlzRootComponent<array<string, mixed>> */ |
| 21 | class OlzStartseite extends OlzRootComponent { |
| 22 | public function hasAccess(): bool { |
| 23 | return true; |
| 24 | } |
| 25 | |
| 26 | public function getSearchTitle(): string { |
| 27 | return 'TODO'; |
| 28 | } |
| 29 | |
| 30 | public function getSearchResultsWhenHasAccess(array $terms): array { |
| 31 | return []; |
| 32 | } |
| 33 | |
| 34 | public static string $title = "Startseite"; |
| 35 | public static string $description = "Eine Übersicht der Neuigkeiten und geplanten Anlässe der OL Zimmerberg."; |
| 36 | |
| 37 | public function getHtmlWhenHasAccess(mixed $args): string { |
| 38 | $this->httpUtils()->validateGetParams(OlzStartseiteParams::class); |
| 39 | |
| 40 | $out = OlzHeader::render([ |
| 41 | 'description' => self::$description, |
| 42 | ], $this); |
| 43 | |
| 44 | $out .= "<div class='content-full'>"; |
| 45 | |
| 46 | $banner_text = OlzEditableText::render(['snippet_id' => 22], $this); |
| 47 | if (trim(strip_tags($banner_text)) !== '' || $this->authUtils()->hasPermission('olz_text_22')) { |
| 48 | $out .= "<div id='important-banner' class='banner'>"; |
| 49 | $out .= $banner_text; |
| 50 | $out .= "</div>"; |
| 51 | } |
| 52 | |
| 53 | $out .= OlzCustomizableHome::render([], $this); |
| 54 | |
| 55 | $out .= "</div>"; |
| 56 | |
| 57 | $out .= OlzFooter::render([], $this); |
| 58 | |
| 59 | return $out; |
| 60 | } |
| 61 | } |