48 lines
2.7 KiB
PHP
48 lines
2.7 KiB
PHP
<?php
|
|
/** @var array $layoutContext */
|
|
$appBaseUrl = $layoutContext['app_base_url'] ?? '';
|
|
|
|
$navLinks = $navLinks ?? [
|
|
['id' => 'dashboard', 'label' => 'Dashboard', 'href' => $appBaseUrl . '/admin/dashboard.php'],
|
|
['id' => 'settings', 'label' => 'Administration','href' => $appBaseUrl . '/admin/settings.php'],
|
|
['id' => 'bridge', 'label' => 'Bridge Setup', 'href' => $appBaseUrl . '/admin/bridge.php'],
|
|
['id' => 'profile', 'label' => 'Mein Konto', 'href' => $appBaseUrl . '/admin/profile.php'],
|
|
];
|
|
|
|
$navActive = $navActive ?? null;
|
|
?>
|
|
<header class="site-header sticky top-0 z-40 border-b border-slate-200 bg-white/90 backdrop-blur">
|
|
<div class="max-w-6xl mx-auto px-4 lg:px-6 flex items-center gap-4 py-3">
|
|
<a href="<?= htmlspecialchars($appBaseUrl . '/index.php') ?>" class="flex items-center gap-2 text-slate-800 font-semibold">
|
|
<span class="inline-flex h-9 w-9 items-center justify-center rounded-xl bg-sky-500 text-white font-bold">ET</span>
|
|
<span class="hidden sm:block">Email Template System</span>
|
|
</a>
|
|
|
|
<nav class="ms-auto hidden md:flex items-center gap-2 text-sm font-medium text-slate-500">
|
|
<?php foreach ($navLinks as $link): ?>
|
|
<?php
|
|
$isActive = $navActive && $navActive === ($link['id'] ?? null);
|
|
$classes = 'px-3 py-1.5 rounded-full transition-colors';
|
|
$classes .= $isActive ? ' bg-sky-100 text-sky-700' : ' hover:text-slate-900';
|
|
?>
|
|
<a href="<?= htmlspecialchars($link['href']) ?>" class="<?= $classes ?>">
|
|
<?= htmlspecialchars($link['label']) ?>
|
|
</a>
|
|
<?php endforeach; ?>
|
|
</nav>
|
|
|
|
<div class="relative ms-auto md:ms-4" id="userMenu">
|
|
<button id="btn-user" type="button" class="btn-avatar" aria-haspopup="true" aria-expanded="false">
|
|
<span id="userAvatar">U</span>
|
|
</button>
|
|
<div id="userMenuPanel" class="user-menu hidden" role="menu">
|
|
<a href="<?= htmlspecialchars($appBaseUrl . '/admin/profile.php') ?>" class="user-menu-item" data-menu="profile">Profil</a>
|
|
<a href="<?= htmlspecialchars($appBaseUrl . '/admin/dashboard.php') ?>" class="user-menu-item" data-role="admin">Dashboard</a>
|
|
<a href="<?= htmlspecialchars($appBaseUrl . '/admin/settings.php') ?>" class="user-menu-item" data-role="admin">Administration</a>
|
|
<a href="<?= htmlspecialchars($appBaseUrl . '/admin/bridge.php') ?>" class="user-menu-item" data-role="admin">Bridge Setup</a>
|
|
<button id="btn-logout" type="button" class="user-menu-item text-red-600">Logout</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</header>
|