'home', 'label' => 'Home', 'icon' => 'home'], ['page' => 'radio', 'label' => 'Radio', 'icon' => 'radio'], ['page' => 'tv', 'label' => 'TV', 'icon' => 'tv'], ['page' => 'podcast', 'label' => 'Podcast', 'icon' => 'mic'], ]; } /** * Icona SVG inline (griglia 24x24, tratto 2px, colore corrente). * Le icone "piene" (play, pause) usano il riempimento invece del tratto. */ function rpi_icon(string $name, int $size = 20, string $class = ''): string { static $icons = [ 'home' => '', 'radio' => '', 'tv' => '', 'mic' => '', 'headphones' => '', 'arrow-left' => '', 'arrow-right' => '', 'external' => '', 'volume' => '', 'mute' => '', 'download' => '', 'close' => '', 'calendar' => '', 'wifi-off' => '', 'refresh' => '', 'info' => '', 'help' => '', 'copyright' => '', 'mail' => '', 'share' => '', 'plus-square' => '', 'more-vertical' => '', 'rss' => '', 'message' => '', 'list' => '', 'shield' => '', 'file-text' => '', 'globe' => '', 'clock' => '', 'sparkles' => '', 'maximize' => '', // Piene 'play' => '', 'pause' => '', ]; if (!isset($icons[$name])) return ''; $filled = in_array($name, ['play', 'pause'], true); $paint = $filled ? 'fill="currentColor"' : 'fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"'; $cls = trim('icon icon-' . $name . ' ' . $class); return ''; } /** Figura decorativa delle sezioni scure: anelli concentrici (il "segno" di RPIGroup Play) */ function rpi_motivo(string $class = ''): string { $cls = trim('motivo ' . $class); $out = ''; } /** * Intestazione di una pagina interna: sfondo del brand, pillola "torna a", etichetta, titolo, sottotitolo. * $o = ['title' => ..., 'eyebrow' => ..., 'subtitle' => ..., 'back' => ['page' => 'home', 'label' => 'Home'], 'class' => ...] */ function rpi_page_header(array $o): void { $title = $o['title'] ?? ''; $eyebrow = $o['eyebrow'] ?? ''; $subtitle = $o['subtitle'] ?? ''; $back = $o['back'] ?? ['page' => 'home', 'label' => 'Home']; $class = $o['class'] ?? ''; ?>
' . rpi_icon('arrow-left', 18) . htmlspecialchars($label) . ''; } /** Link legali e versione: nella sidebar (desktop) e in fondo alla home (telefono) */ function rpi_legal_links(): array { return [ ['page' => 'page/termini-condizioni', 'label' => 'Termini e Condizioni'], ['page' => 'page/policy-privacy', 'label' => 'Policy Privacy'], ['page' => 'page/changelog', 'label' => 'Changelog'], ]; } /** Dati di una stazione radio per il player (attributo data-station) */ function rpi_station_json($station): string { return htmlspecialchars(json_encode([ 'id' => (int)$station->id, 'name' => (string)$station->name, 'slogan' => (string)$station->slogan, 'logo' => (string)$station->logo, 'stream' => (string)$station->stream, 'streamhls' => (string)$station->streamhls, 'api' => (string)$station->apiradio, ], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE), ENT_QUOTES, 'UTF-8'); }