This commit is contained in:
2026-03-07 23:58:40 +01:00
parent 766eab12e7
commit 12c2ce4817
10 changed files with 652 additions and 96 deletions

View File

@@ -71,9 +71,37 @@ $sidebarItems = $moduleSidebar['items'] ?? [];
<?php if ($moduleMenu): ?>
<div class="module-subnav card">
<?php foreach ($moduleMenu as $entry): ?>
<a class="nav-link" href="<?= e($entry['href'] ?? '#') ?>">
<?= e($entry['label'] ?? 'Link') ?>
</a>
<?php
$href = (string)($entry['href'] ?? '');
$label = (string)($entry['label'] ?? 'Link');
$children = is_array($entry['children'] ?? null) ? $entry['children'] : [];
$isSetup = $href !== '' && str_starts_with($href, '/modules/setup/');
if ($isSetup) {
continue;
}
?>
<?php if ($children): ?>
<div class="nav-dropdown">
<button class="nav-link nav-link-button" type="button"><?= e($label) ?> ▾</button>
<div class="nav-dropdown-menu">
<?php foreach ($children as $child): ?>
<?php
$childHref = (string)($child['href'] ?? '');
if ($childHref !== '' && str_starts_with($childHref, '/modules/setup/')) {
continue;
}
?>
<a class="nav-link" href="<?= e($childHref ?: '#') ?>">
<?= e((string)($child['label'] ?? 'Link')) ?>
</a>
<?php endforeach; ?>
</div>
</div>
<?php else: ?>
<a class="nav-link" href="<?= e($href ?: '#') ?>">
<?= e($label) ?>
</a>
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
@@ -90,7 +118,13 @@ $sidebarItems = $moduleSidebar['items'] ?? [];
<?php endif; ?>
<div class="sidebar-items">
<?php foreach ($sidebarItems as $item): ?>
<a class="nav-link" href="<?= e($item['href'] ?? '#') ?>"><?= e($item['label'] ?? 'Item') ?></a>
<?php
$itemHref = (string)($item['href'] ?? '');
if ($itemHref !== '' && str_starts_with($itemHref, '/modules/setup/')) {
continue;
}
?>
<a class="nav-link" href="<?= e($itemHref ?: '#') ?>"><?= e($item['label'] ?? 'Item') ?></a>
<?php endforeach; ?>
</div>
</aside>