Dashboard, Mein Profil, Raids and the admin pages (Benutzerverwaltung/ Berechtigungsgruppen) each get a distinct backdrop behind the panels, via a page->background map in header.php and a dark gradient overlay so text stays readable. Raids uses the darkest/most dramatic image as requested. Generated compressed 1920px-wide JPEG copies under Landscapes/web/ for actual use on the page - the original PNGs were up to 11.7MB (landscape4), which would have made every page load painfully slow. Originals are kept untouched alongside them. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
92 lines
4.3 KiB
PHP
92 lines
4.3 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');
|
|
$showAdminMenu = $canViewUsers || $canManageRoles;
|
|
|
|
$currentScript = basename((string) ($_SERVER['SCRIPT_NAME'] ?? ''));
|
|
$isDashboardActive = $currentScript === 'dashboard.php';
|
|
$isProfileActive = $currentScript === 'profile.php';
|
|
$isRaidsActive = $currentScript === 'raids.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',
|
|
'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">
|
|
<title><?= e(($pageTitle ?? '') !== '' ? $pageTitle . ' - Aion2 Gilde' : 'Aion2 Gilde') ?></title>
|
|
<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.png" 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 ($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">Angemeldet als<br><strong><?= e($currentUser['display_name'] !== '' ? $currentUser['display_name'] : $currentUser['username']) ?></strong></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.png" 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; ?>
|