107 lines
4.2 KiB
PHP
Executable File
107 lines
4.2 KiB
PHP
Executable File
<?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): ?>
|
|
<a class="nav-link" href="<?= e($entry['href'] ?? '#') ?>">
|
|
<?= e($entry['label'] ?? 'Link') ?>
|
|
</a>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<div class="layout-body <?= $sidebarEnabled ? 'has-sidebar' : 'no-sidebar' ?> <?= $sidebarDefault === 'open' ? 'sidebar-open' : 'sidebar-collapsed' ?>"
|
|
data-sidebar-enabled="<?= $sidebarEnabled ? '1' : '0' ?>"
|
|
data-sidebar-collapsible="<?= $sidebarCollapsible ? '1' : '0' ?>"
|
|
data-sidebar-default="<?= e($sidebarDefault) ?>">
|
|
|
|
<?php if ($sidebarEnabled): ?>
|
|
<aside class="sidebar card">
|
|
<?php if ($sidebarCollapsible): ?>
|
|
<button class="sidebar-toggle" data-sidebar-toggle aria-label="Menü ein-/ausklappen">»»</button>
|
|
<?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 endforeach; ?>
|
|
</div>
|
|
</aside>
|
|
<?php endif; ?>
|
|
|
|
<main class="main-content">
|
|
<?php if ($sidebarEnabled && $sidebarCollapsible): ?>
|
|
<button class="sidebar-fab" data-sidebar-toggle aria-label="Menü einblenden">»»</button>
|
|
<?php endif; ?>
|
|
|
|
<?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; ?>
|