Display-Seiten individuell gestalten
Some checks are pending
CI / PHP Lint (push) Waiting to run
CI / PHP Lint (pull_request) Waiting to run
CI / PHP Lint-1 (pull_request) Waiting to run
CI / PHP Lint-1 (push) Waiting to run
CI / Unit Tests & Static Analysis (pull_request) Waiting to run
CI / Unit Tests & Static Analysis (push) Waiting to run
Some checks are pending
CI / PHP Lint (push) Waiting to run
CI / PHP Lint (pull_request) Waiting to run
CI / PHP Lint-1 (pull_request) Waiting to run
CI / PHP Lint-1 (push) Waiting to run
CI / Unit Tests & Static Analysis (pull_request) Waiting to run
CI / Unit Tests & Static Analysis (push) Waiting to run
Jede Display-Seite bringt jetzt ihr eigenes Erscheinungsbild mit – der Empfang sieht anders aus als der Tagungsraum nebenan: - eigenes Logo (leer = Logo aus den Einstellungen) - formatfüllendes Hintergrundbild mit einstellbarer Abdunklung (0–90 %), damit die Karte auf hellen Fotos lesbar bleibt - eigene Akzentfarbe für den Knopf (leer = Farbe aus dem Design-Tab) - Karte wahlweise hell oder dunkel; auf Fotos wirkt dunkel meist ruhiger Logo und Hintergrund lassen sich hochladen oder als URL hinterlegen; beim Löschen einer Display-Seite verschwinden die hochgeladenen Dateien mit. Nebenbei aufgeräumt: das Bildfeld (Vorschau + Upload + URL + Entfernen) lag als Funktion in admin/settings.php und wird jetzt von beiden Seiten genutzt – Ui::imageField() für die Darstellung, Upload::resolveField() für die Auswertung. Sicherheit: die Akzentfarbe landet in einem style-Attribut, deshalb wird sie sowohl beim Speichern als auch beim Ausgeben auf eine echte Hex-Farbe geprüft; ein Test hält das fest. Migration 0006, database.sql nachgezogen, 4 neue Tests (42 gesamt), Screenshots ergänzt, Version 2.8.0. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
943e427150
commit
4159b92268
31 changed files with 405 additions and 82 deletions
|
|
@ -124,6 +124,35 @@ class Kiosk
|
|||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gestaltung einer Display-Seite: eigene Werte, sonst die des Systems.
|
||||
*
|
||||
* @return array{logo:string,background:string,overlay:float,accent:string,card:string}
|
||||
*/
|
||||
public static function appearance($db, array $kiosk): array
|
||||
{
|
||||
$accent = strtolower(trim((string)($kiosk['accent_color'] ?? '')));
|
||||
if (!preg_match('/^#[0-9a-f]{6}$/', $accent)) {
|
||||
$accent = '';
|
||||
}
|
||||
|
||||
$overlay = (int)($kiosk['bg_overlay'] ?? 45);
|
||||
$overlay = max(0, min(90, $overlay));
|
||||
|
||||
$logo = trim((string)($kiosk['logo_url'] ?? ''));
|
||||
if ($logo === '' && $db) {
|
||||
$logo = (string)$db->getSetting('logo_url', '');
|
||||
}
|
||||
|
||||
return [
|
||||
'logo' => $logo,
|
||||
'background' => trim((string)($kiosk['background_url'] ?? '')),
|
||||
'overlay' => (float)$overlay / 100, // immer float, auch bei 0
|
||||
'accent' => $accent,
|
||||
'card' => ($kiosk['card_style'] ?? 'light') === 'dark' ? 'dark' : 'light',
|
||||
];
|
||||
}
|
||||
|
||||
/** Öffentliche Adresse eines Kiosks. */
|
||||
public static function publicUrl(string $token, string $baseUrl = ''): string
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue