Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 16 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| OlzStartseiteParams | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||
| OlzStartseite | |
0.00% |
0 / 16 |
|
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 / 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 getSearchTitle(): string { |
| 23 | return 'TODO'; |
| 24 | } |
| 25 | |
| 26 | public function getSearchResults(array $terms): array { |
| 27 | return []; |
| 28 | } |
| 29 | |
| 30 | public static string $title = "Startseite"; |
| 31 | public static string $description = "Eine Übersicht der Neuigkeiten und geplanten Anlässe der OL Zimmerberg."; |
| 32 | |
| 33 | public function getHtml(mixed $args): string { |
| 34 | $this->httpUtils()->validateGetParams(OlzStartseiteParams::class); |
| 35 | |
| 36 | $out = OlzHeader::render([ |
| 37 | 'description' => self::$description, |
| 38 | ], $this); |
| 39 | |
| 40 | $out .= "<div class='content-full'>"; |
| 41 | |
| 42 | $banner_text = OlzEditableText::render(['snippet_id' => 22], $this); |
| 43 | if (trim(strip_tags($banner_text)) !== '' || $this->authUtils()->hasPermission('olz_text_22')) { |
| 44 | $out .= "<div id='important-banner' class='banner'>"; |
| 45 | $out .= $banner_text; |
| 46 | $out .= "</div>"; |
| 47 | } |
| 48 | |
| 49 | $out .= OlzCustomizableHome::render([], $this); |
| 50 | |
| 51 | $out .= "</div>"; |
| 52 | |
| 53 | $out .= OlzFooter::render([], $this); |
| 54 | |
| 55 | return $out; |
| 56 | } |
| 57 | } |