feat: Navigation hinzugefügt und URL-Struktur in .htaccess optimiert

This commit is contained in:
Troy Grunt
2026-02-07 22:22:03 +01:00
parent 4f32bf68ca
commit de352e0335
3 changed files with 35 additions and 5 deletions

View File

@@ -26,8 +26,36 @@
<header>
<h1>Netzwerk-Dokumentation</h1>
<!-- TODO: Navigation einfügen -->
<!-- Beispiel: Links zu Dashboard, Gerätetypen, Geräte, Racks, Floors, Connections -->
<?php
$currentPath = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
$navItems = [
'/' => 'Dashboard',
'/device-types' => 'Gerätetypen',
'/devices' => 'Geräte',
'/racks' => 'Racks',
'/floors' => 'Grundrisse',
'/connections' => 'Verbindungen',
];
?>
<nav class="main-nav">
<ul>
<?php foreach ($navItems as $url => $label): ?>
<?php
$active = ($currentPath === $url || str_starts_with($currentPath, $url . '/'))
? 'active'
: '';
?>
<li class="<?= $active ?>">
<a href="<?= htmlspecialchars($url) ?>">
<?= htmlspecialchars($label) ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</nav>
</header>
<main>