query("SELECT * FROM navbar ORDER BY id"); while ($row = $navbarResult->fetchArray(SQLITE3_ASSOC)) { $navbarItems[] = $row; } // Function to render the navbar items im grosse navbar für normali mensche function render_navbar($items, $currentPage) { $leftItems = array_filter($items, fn($item) => $item['align'] === 'left'); $centerItems = array_filter($items, fn($item) => $item['align'] === 'center'); $rightItems = array_filter($items, fn($item) => $item['align'] === 'right'); echo '
'; echo ' '; echo ' '; } function render_navbar_items($items, $currentPage) { foreach ($items as $item) { $activeClass = ($item['link'] == "?page=$currentPage") ? ' class="active"' : ''; switch ($item['type']) { case 'title': echo ' '; break; case 'link': echo '' . htmlspecialchars($item['name']) . ''; break; case 'drop down': echo ' '; break; case 'text field': echo ''; break; case 'button': echo ''; break; case 'custom': echo $item['link_text']; break; case 'logo': echo '