feat: Navigation hinzugefügt und URL-Struktur in .htaccess optimiert
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user