LuminaWebsite/includes/header.php
Maaxxs 976c0e23b2 Use the current logo as favicon, add a new compact site logo
The original logo.png (the full illustrated artwork) is now generated
into a proper favicon set (favicon.ico, 16/32/48px PNGs, apple-touch-
icon) and wired up via <link rel="icon"> tags - it was never used as
the browser tab icon before.

logo.png itself doesn't work as the actual site logo in the sidebar/
navbar: at 56px/40px tall it's illegible (dense illustration + small
wordmark). There's no image-generation tool available in this session,
so instead of a new illustrated piece, added assets/images/logo-mark.svg:
a hand-built vector wordmark ("LUMINA" + a gold sunburst/wing emblem
with a small center gem) in the site's existing gold/dark palette,
echoing the wings/sigil/gem motifs of the original artwork but
designed to stay crisp at small sizes. Replaces logo.png in both
sidebar-brand and navbar-brand; the original PNG is left in place
unreferenced, still the source the favicons were generated from.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-19 15:28:13 +02:00

117 lines
5.7 KiB
PHP

<?php
/** @var string|null $pageTitle */
$currentUser = current_user();
$canViewUsers = $currentUser && user_has_permission('users.view');
$canManageRoles = $currentUser && user_has_permission('roles.manage');
$canViewRaids = $currentUser && user_has_permission('raids.view');
$canViewPremades = $currentUser && user_has_permission('premades.view');
$canViewMembers = $currentUser && user_has_permission('members.view');
$showAdminMenu = $canViewUsers || $canManageRoles;
$currentScript = basename((string) ($_SERVER['SCRIPT_NAME'] ?? ''));
$isDashboardActive = $currentScript === 'dashboard.php';
$isProfileActive = $currentScript === 'profile.php';
$isRaidsActive = $currentScript === 'raids.php';
$isPremadesActive = $currentScript === 'premades.php';
$isMembersActive = $currentScript === 'members.php';
$isUsersActive = in_array($currentScript, ['users.php', 'user_form.php', 'user_delete.php'], true);
$isRolesActive = in_array($currentScript, ['roles.php', 'role_form.php', 'role_delete.php'], true);
// Jeder Bereich bekommt ein eigenes, dezentes Hintergrundbild.
$pageBackgrounds = [
'dashboard.php' => 'bg-dashboard',
'profile.php' => 'bg-profile',
'raids.php' => 'bg-raids',
'premades.php' => 'bg-raids',
'members.php' => 'bg-profile',
'users.php' => 'bg-admin',
'user_form.php' => 'bg-admin',
'user_delete.php' => 'bg-admin',
'roles.php' => 'bg-admin',
'role_form.php' => 'bg-admin',
'role_delete.php' => 'bg-admin',
];
$pageBackgroundClass = $pageBackgrounds[$currentScript] ?? '';
?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="csrf-token" content="<?= e(csrf_token()) ?>">
<title><?= e(($pageTitle ?? '') !== '' ? $pageTitle . ' - Aion2 Gilde' : 'Aion2 Gilde') ?></title>
<link rel="icon" type="image/x-icon" href="/assets/images/favicon.ico">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/images/favicon-16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/images/favicon-32.png">
<link rel="icon" type="image/png" sizes="48x48" href="/assets/images/favicon-48.png">
<link rel="apple-touch-icon" href="/assets/images/apple-touch-icon.png">
<link rel="stylesheet" href="/assets/css/style.css">
</head>
<body>
<?php if ($currentUser): ?>
<div class="app-shell">
<aside class="sidebar">
<div class="sidebar-brand"><a href="/"><img src="/assets/images/logo-mark.svg" alt="Aion2 Gilde"></a></div>
<nav class="sidebar-nav">
<a href="/dashboard.php" class="sidebar-link<?= $isDashboardActive ? ' active' : '' ?>" title="Dashboard">
<?= icon('home') ?><span class="label">Dashboard</span>
</a>
<a href="/profile.php" class="sidebar-link<?= $isProfileActive ? ' active' : '' ?>" title="Mein Profil">
<?= icon('profile') ?><span class="label">Mein Profil</span>
</a>
<?php if ($canViewRaids): ?>
<a href="/raids.php" class="sidebar-link<?= $isRaidsActive ? ' active' : '' ?>" title="Raids">
<?= icon('calendar') ?><span class="label">Raids</span>
</a>
<?php endif; ?>
<?php if ($canViewPremades): ?>
<a href="/premades.php" class="sidebar-link<?= $isPremadesActive ? ' active' : '' ?>" title="Premades">
<?= icon('shield') ?><span class="label">Premades</span>
</a>
<?php endif; ?>
<?php if ($canViewMembers): ?>
<a href="/members.php" class="sidebar-link<?= $isMembersActive ? ' active' : '' ?>" title="Mitglieder">
<?= icon('users') ?><span class="label">Mitglieder</span>
</a>
<?php endif; ?>
<?php if ($showAdminMenu): ?>
<div class="sidebar-section-label">Admin</div>
<?php if ($canViewUsers): ?>
<a href="/admin/users.php" class="sidebar-link<?= $isUsersActive ? ' active' : '' ?>" title="Benutzerverwaltung">
<?= icon('users') ?><span class="label">Benutzerverwaltung</span>
</a>
<?php endif; ?>
<?php if ($canManageRoles): ?>
<a href="/admin/roles.php" class="sidebar-link<?= $isRolesActive ? ' active' : '' ?>" title="Berechtigungsgruppen">
<?= icon('shield') ?><span class="label">Berechtigungsgruppen</span>
</a>
<?php endif; ?>
<?php endif; ?>
</nav>
<div class="sidebar-footer">
<div class="sidebar-user">
<?= avatar_html($currentUser, 36) ?>
<div>Angemeldet als<br><strong><?= e($currentUser['display_name'] !== '' ? $currentUser['display_name'] : $currentUser['username']) ?></strong></div>
</div>
<a href="/logout.php" class="sidebar-link" title="Abmelden">
<?= icon('log-out') ?><span class="label">Abmelden</span>
</a>
</div>
</aside>
<div class="app-content<?= $pageBackgroundClass ? ' ' . e($pageBackgroundClass) : '' ?>">
<main class="container">
<?php foreach (get_flashes() as $flash): ?>
<div class="flash flash-<?= e($flash['type']) ?>"><?= e($flash['message']) ?></div>
<?php endforeach; ?>
<?php else: ?>
<header class="navbar">
<div class="navbar-brand"><a href="/"><img src="/assets/images/logo-mark.svg" alt="Aion2 Gilde"></a></div>
<div class="navbar-user">
<a href="/login.php">Login</a>
</div>
</header>
<main class="container">
<?php foreach (get_flashes() as $flash): ?>
<div class="flash flash-<?= e($flash['type']) ?>"><?= e($flash['message']) ?></div>
<?php endforeach; ?>
<?php endif; ?>