mit Versionsstempel. */ public static function script(string $path, string $base = '', bool $defer = false): string { return ''; } /** * Theme-Bootstrap: gespeicherte Auswahl, sonst Systemeinstellung. * Muss im
stehen, damit nichts hell aufblitzt. */ public static function themeScript(): string { return ''; } /** Gueltige Hex-Farbe oder Fallback. */ private static function color(?string $value, string $fallback): string { $value = trim((string)$value); return preg_match('/^#[0-9a-fA-F]{6}$/', $value) ? strtolower($value) : $fallback; } /** * CSS-Overrides fuer die Markenfarben. Gibt einen leeren String zurueck, * wenn nichts vom Standard abweicht. */ public static function brandingStyle($db = null): string { if (!$db) { return ''; } $accent = self::color($db->getSetting('brand_accent', ''), self::DEFAULT_ACCENT); $accentDark = self::color($db->getSetting('brand_accent_dark', ''), self::DEFAULT_ACCENT_DARK); $from = self::color($db->getSetting('brand_gradient_from', ''), self::DEFAULT_GRADIENT_FROM); $to = self::color($db->getSetting('brand_gradient_to', ''), self::DEFAULT_GRADIENT_TO); $radius = (int)$db->getSetting('brand_radius', (string)self::DEFAULT_RADIUS); $radius = max(0, min(28, $radius)); $isDefault = $accent === self::DEFAULT_ACCENT && $accentDark === self::DEFAULT_ACCENT_DARK && $from === self::DEFAULT_GRADIENT_FROM && $to === self::DEFAULT_GRADIENT_TO && $radius === self::DEFAULT_RADIUS; if ($isDefault) { return ''; } // Abgeleitete Töne über color-mix – so genügt eine einzige Grundfarbe. return ''; } /** * Bildfeld mit Vorschau, Upload und URL-Eingabe. * Wird von den Einstellungen und der Kiosk-Verwaltung genutzt. */ public static function imageField( string $name, string $label, ?string $value, string $hint = '', string $accept = 'image/*', string $base = '../' ): string { $value = (string)$value; $preview = self::mediaUrl($value, $base); $esc = static fn ($text) => htmlspecialchars((string)$text, ENT_QUOTES); $t = static fn ($key, $fallback) => function_exists('__') ? __($key) : $fallback; $thumb = $preview !== '' ? '' . $prefix . htmlspecialchars($label) . ' ' . '' . self::CREDIT_NAME . '
'; } /** * Standard-Druckvorlage (wird nur verwendet, solange keine eigene * Vorlage gespeichert ist). {QR_CODE} fuellt der Browser. */ public static function defaultPrintTemplate(): string { $validUntil = function_exists('__') ? __('print_valid_until') : 'Gültig bis'; $devices = function_exists('__') ? __('print_devices') : 'Geräte'; return '