feat: Navigation hinzugefügt und URL-Struktur in .htaccess optimiert
This commit is contained in:
@@ -20,7 +20,9 @@ RewriteEngine On
|
|||||||
# Alles auf index.php umleiten, außer echte Dateien/Verzeichnisse
|
# Alles auf index.php umleiten, außer echte Dateien/Verzeichnisse
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
RewriteCond %{REQUEST_FILENAME} !-d
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
RewriteRule ^(.*)$ index.php [QSA,L]
|
RewriteRule ^([a-z\-]*)$ index.php?module=$1 [QSA,L]
|
||||||
|
RewriteRule ^([a-z\-]*)/([a-z]*)$ index.php?module=$1&action=$2 [QSA,L]
|
||||||
|
RewriteRule ^$ index.php [QSA,L]
|
||||||
|
|
||||||
# =========================
|
# =========================
|
||||||
# Standard-Dokument
|
# Standard-Dokument
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<a href="/?page=floors/edit&id=1">Bearbeiten</a>
|
<a href="/floors/edit?id=1">Bearbeiten</a>
|
||||||
<button>Löschen</button>
|
<button>Löschen</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -91,6 +91,6 @@
|
|||||||
<?php /* if (empty($floors)): */ ?>
|
<?php /* if (empty($floors)): */ ?>
|
||||||
<div class="empty-state">
|
<div class="empty-state">
|
||||||
<p>Noch keine Stockwerke angelegt.</p>
|
<p>Noch keine Stockwerke angelegt.</p>
|
||||||
<p><a href="/?page=floors/edit">Erstes Stockwerk anlegen</a></p>
|
<p><a href="/floors/edit">Erstes Stockwerk anlegen</a></p>
|
||||||
</div>
|
</div>
|
||||||
<?php /* endif; */ ?>
|
<?php /* endif; */ ?>
|
||||||
|
|||||||
@@ -26,8 +26,36 @@
|
|||||||
<header>
|
<header>
|
||||||
<h1>Netzwerk-Dokumentation</h1>
|
<h1>Netzwerk-Dokumentation</h1>
|
||||||
|
|
||||||
<!-- TODO: Navigation einfügen -->
|
<?php
|
||||||
<!-- Beispiel: Links zu Dashboard, Gerätetypen, Geräte, Racks, Floors, Connections -->
|
$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>
|
</header>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
|
|||||||
Reference in New Issue
Block a user