Files
nexus/partials/structure/layout_start.php
2026-03-08 00:35:42 +01:00

135 lines
5.1 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/** @var \App\App $app */
$app = app();
$app->assets()->addStyle('/assets/css/app.css', 'early');
$app->assets()->addScript('/assets/js/app.js', 'footer', true);
$theme = user_theme();
$currentModule = current_module_name();
$path = $app->request()->path();
$moduleMenu = [];
$moduleSidebar = [];
if ($currentModule) {
$module = modules()->get($currentModule);
$moduleMenu = $module['menu'] ?? [];
$moduleSidebar = $module['sidebar'] ?? [];
}
$sidebarEnabled = !empty($moduleSidebar['enabled']);
$sidebarCollapsible = !empty($moduleSidebar['collapsible']);
$sidebarDefault = ($moduleSidebar['default'] ?? 'collapsed') === 'open' ? 'open' : 'collapsed';
$sidebarItems = $moduleSidebar['items'] ?? [];
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?= htmlspecialchars(t('common.title'), ENT_QUOTES) ?></title>
<?php asset_styles(); ?>
<?php asset_scripts('header'); ?>
</head>
<body data-theme="<?= e($theme) ?>">
<div class="bg-orb orb-a"></div>
<div class="bg-orb orb-b"></div>
<header class="site-header card">
<div class="logo-wrap">
<img src="/assets/images/logo.png" alt="Nexus Logo" class="site-logo">
</div>
<nav class="header-nav">
<a class="nav-link" href="/">Dashboard</a>
<div class="dropdown">
<button class="nav-link dropdown-toggle" type="button">Module ▾</button>
<div class="dropdown-menu">
<?php foreach (modules()->all() as $m): ?>
<?php if (!empty($m['enabled'])): ?>
<a class="dropdown-item" href="/module/<?= e($m['name']) ?>"><?= e($m['title']) ?></a>
<?php endif; ?>
<?php endforeach; ?>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="/modules">Module Übersicht</a>
<a class="dropdown-item" href="/modules/install">Modul installieren/aktivieren</a>
<a class="dropdown-item" href="/settings">Settings</a>
</div>
</div>
<div class="dropdown">
<?php if (auth_enabled() && auth_user()): ?>
<button class="avatar-btn" type="button">
<span class="avatar"><?= e(auth_initials()) ?></span>
</button>
<div class="dropdown-menu dropdown-menu-right">
<div class="dropdown-header"><?= e(auth_display_name()) ?></div>
<a class="dropdown-item" href="/settings">User-Settings</a>
<a class="dropdown-item" href="/auth/logout">Logout</a>
</div>
<?php elseif (auth_enabled()): ?>
<a class="nav-link" href="/auth/login">Login</a>
<?php endif; ?>
</div>
</nav>
</header>
<?php if ($moduleMenu): ?>
<div class="module-subnav card">
<?php foreach ($moduleMenu as $entry): ?>
<?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; ?>
<div class="layout-body no-sidebar sidebar-collapsed"
data-sidebar-enabled="0"
data-sidebar-collapsible="0"
data-sidebar-default="collapsed">
<main class="main-content">
<button class="console-fab" type="button" data-console-fab title="Konsole öffnen">
<span></span>
</button>
<div class="console-modal" data-console-modal aria-hidden="true">
<div class="console-modal-card">
<div class="console-modal-header">
<strong>Konsole Tabs</strong>
<button class="icon-button" type="button" data-console-close>×</button>
</div>
<div class="console-tabs" data-console-tabs style="margin-top:12px;">
<div class="console-tab-bar" data-console-tab-bar></div>
<div class="console-tab-panels" data-console-tab-panels></div>
</div>
</div>
</div>
<?php if (defined('APP_DEBUG_TOOL') && APP_DEBUG_TOOL && auth_is_admin()): ?>
<button class="debug-fab" data-debug-open title="Debug" type="button">🐞</button>
<?php endif; ?>