This commit is contained in:
2026-02-04 23:31:53 +01:00
commit cd59ccd99b
2401 changed files with 56808 additions and 0 deletions

BIN
templates/.DS_Store vendored Normal file

Binary file not shown.

104
templates/default.phtml Normal file
View File

@@ -0,0 +1,104 @@
<?php
use MintyPHP\Buffer;
$defaultTitle = appTitle();
$user = $_SESSION['user'] ?? [];
$isLoggedIn = !empty($user['id']);
$theme = appDefaultTheme();
$userTheme = strtolower(trim((string) ($user['theme'] ?? '')));
$primaryVars = appPrimaryCssVars();
if (allowUserTheme() && in_array($userTheme, ['light', 'dark'], true)) {
$theme = $userTheme;
}
?>
<!DOCTYPE html>
<html data-theme="<?php e($theme); ?>" class="no-js" <?php if ($primaryVars !== ''): ?>style="<?php e($primaryVars); ?>"<?php endif; ?>>
<head>
<script>
(function () {
var root = document.documentElement;
root.classList.remove('no-js');
root.classList.add('js');
window.APP_ASSET_BASE = "<?php e(asset('')); ?>";
try {
if (window.localStorage.getItem('app-sidebar-collapsed') === '1') {
root.classList.add('sidebar-collapsed');
}
} catch (e) {
console.warn('app: sidebar state not available', e);
}
})();
</script>
<base href="<?php e(localeBase()); ?>">
<title><?php e($defaultTitle); ?> <?php if (Buffer::get('title'))
; ?></title>
<meta property="og:site_name" content="<?php e($defaultTitle); ?>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" sizes="32x32" href="<?php e(appFaviconUrl('favicon-32x32.png')); ?>">
<link rel="icon" type="image/png" sizes="16x16" href="<?php e(appFaviconUrl('favicon-16x16.png')); ?>">
<link rel="apple-touch-icon" href="<?php e(appFaviconUrl('apple-touch-icon.png')); ?>">
<link rel="manifest" href="<?php e(asset('favicon/site.webmanifest')); ?>">
<link href="<?php e(asset('css/base/variables.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('vendor/gridjs/mermaid.min.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('vendor/multi-select/MultiSelect.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/vendor-multi-select.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('vendor/bootstrap-icons/bootstrap-icons.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-badges.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/layout/app-shell.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-blockquote.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-forms.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-buttons.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/vendor-gridjs.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-flash.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-brand.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/layout/app-topbar.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/layout/app-sidebar.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-search.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-list-titlebar.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-details-titlebar.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-dashboard-titlebar.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-details.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-profile.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-list-table.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-list-tabs.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-tabs.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-list-toolbar.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-breadcrumb.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-tile.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-tooltips.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-page-editor.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/vendor-editorjs.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-page-copy.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/layout/app-aside-icon-bar.css')); ?>" rel="stylesheet">
</head>
<body>
<div class="app-container">
<?php if ($isLoggedIn): ?>
<?php require __DIR__ . '/partials/app-aside-icon-bar.phtml'; ?>
<?php require __DIR__ . '/partials/app-aside.phtml'; ?>
<?php endif; ?>
<div class="app-main">
<main>
<?php if ($isLoggedIn): ?>
<?php require __DIR__ . '/partials/app-topbar.phtml'; ?>
<?php endif; ?>
<div class="app-main-content">
<?php require __DIR__ . '/partials/app-flash.phtml'; ?>
<?php Buffer::get('html'); ?>
</div>
</main>
<?php require __DIR__ . '/partials/app-footer.phtml'; ?>
</div>
</div>
<script src="<?php e(asset('vendor/fslightbox/fslightbox.js')); ?>"></script>
<?php $appInitVersion = @filemtime('web/js/app-init.js') ?: time(); ?>
<script type="module" src="<?php e(asset('js/app-init.js?v=' . $appInitVersion)); ?>"></script>
</body>
</html>

View File

@@ -0,0 +1,18 @@
<!doctype html>
<html lang="de">
<body style="font-family: Arial, sans-serif; line-height: 1.5; color: #111;">
{{email_header}}
<p>{{greeting}}</p>
<p>dein Zugang wurde eingerichtet.</p>
<p><strong>Benutzername:</strong> {{username}}</p>
<p>
<a href="{{login_url}}">Zur Anmeldung</a>
</p>
<p>
Falls du dein Passwort nicht kennst, kannst du es hier zurücksetzen:
<a href="{{reset_url}}">Passwort vergessen</a>
</p>
<p>Viele Grüße<br>{{app_name}}</p>
{{email_footer}}
</body>
</html>

View File

@@ -0,0 +1,17 @@
{{email_header_text}}
{{greeting}}
dein Zugang wurde eingerichtet.
Benutzername: {{username}}
Zur Anmeldung:
{{login_url}}
Falls du dein Passwort nicht kennst, kannst du es hier zurücksetzen:
{{reset_url}}
Viele Grüße
{{app_name}}
{{email_footer_text}}

View File

@@ -0,0 +1,15 @@
<!doctype html>
<html lang="de">
<body style="font-family: Arial, sans-serif; line-height: 1.5; color: #111;">
{{email_header}}
<p>{{greeting}}</p>
<p>Vielen Dank für deine Registrierung! Bitte bestätige deine E-Mail-Adresse mit folgendem Code:</p>
<p style="font-size: 20px; font-weight: bold; letter-spacing: 2px;">{{code}}</p>
<p>Dieser Code ist {{expires_minutes}} Minuten gültig.</p>
<p>Du kannst den Code hier eingeben:</p>
<p><a href="{{verify_url}}">{{verify_url}}</a></p>
<p>Wenn du dich nicht registriert hast, kannst du diese E-Mail ignorieren.</p>
<p>Viele Grüße<br>{{app_name}}</p>
{{email_footer}}
</body>
</html>

View File

@@ -0,0 +1,18 @@
{{email_header_text}}
{{greeting}}
Vielen Dank für deine Registrierung! Bitte bestätige deine E-Mail-Adresse mit folgendem Code:
Dein Code: {{code}}
Dieser Code ist {{expires_minutes}} Minuten gültig.
Code hier eingeben:
{{verify_url}}
Wenn du dich nicht registriert hast, kannst du diese E-Mail ignorieren.
Viele Grüße
{{app_name}}
{{email_footer_text}}

View File

@@ -0,0 +1,16 @@
</td>
</tr>
<tr>
<td style="padding:12px 24px 20px; border-top:1px solid #e6e6e6; font-size:12px; color:#555;">
<div style="margin-bottom:8px;">
<a href="{{imprint_url}}" style="color:#555; text-decoration:underline;">Impressum</a>
&nbsp;·&nbsp;
<a href="{{privacy_url}}" style="color:#555; text-decoration:underline;">Datenschutz</a>
</div>
{{app_name}} · Diese E-Mail wurde automatisch erstellt.
</td>
</tr>
</table>
</td>
</tr>
</table>

View File

@@ -0,0 +1,2 @@
---
{{app_name}} · Diese E-Mail wurde automatisch erstellt.

View File

@@ -0,0 +1,14 @@
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="background:#f5f5f5; padding:24px 0;">
<tr>
<td align="center">
<table role="presentation" width="600" cellspacing="0" cellpadding="0" style="background:#ffffff; color:#111; border:1px solid #e6e6e6; border-radius:12px; width:100%; max-width:600px;">
<tr>
<td style="padding:20px 24px 12px; border-bottom:1px solid #e6e6e6;">
<div style="font-size:18px; font-weight:700; color:#111;">
<img src="{{app_logo_url}}" alt="{{app_name}}" height="32" style="display:inline-block; vertical-align:middle; margin-right:8px;">
<span style="vertical-align:middle;">{{app_name}}</span>
</div>
</td>
</tr>
<tr>
<td style="padding:16px 24px 4px;">

View File

@@ -0,0 +1,2 @@
{{app_name}}
=================

View File

@@ -0,0 +1,15 @@
<!doctype html>
<html lang="de">
<body style="font-family: Arial, sans-serif; line-height: 1.5; color: #111;">
{{email_header}}
<p>{{greeting}}</p>
<p>du hast einen Code zum Zurücksetzen deines Passworts angefordert.</p>
<p style="font-size: 20px; font-weight: bold; letter-spacing: 2px;">{{code}}</p>
<p>Dieser Code ist {{expires_minutes}} Minuten gültig.</p>
<p>Du kannst den Code hier eingeben:</p>
<p><a href="{{verify_url}}">{{verify_url}}</a></p>
<p>Wenn du diese Anfrage nicht gestellt hast, kannst du diese E-Mail ignorieren.</p>
<p>Viele Grüße<br>{{app_name}}</p>
{{email_footer}}
</body>
</html>

View File

@@ -0,0 +1,18 @@
{{email_header_text}}
{{greeting}}
du hast einen Code zum Zurücksetzen deines Passworts angefordert.
Dein Code: {{code}}
Dieser Code ist {{expires_minutes}} Minuten gültig.
Code hier eingeben:
{{verify_url}}
Wenn du diese Anfrage nicht gestellt hast, kannst du diese E-Mail ignorieren.
Viele Grüße
{{app_name}}
{{email_footer_text}}

View File

@@ -0,0 +1,18 @@
<!doctype html>
<html lang="en">
<body style="font-family: Arial, sans-serif; line-height: 1.5; color: #111;">
{{email_header}}
<p>{{greeting}}</p>
<p>Your access has been set up.</p>
<p><strong>Username:</strong> {{username}}</p>
<p>
<a href="{{login_url}}">Go to login</a>
</p>
<p>
If you do not know your password, you can reset it here:
<a href="{{reset_url}}">Forgot password</a>
</p>
<p>Best regards<br>{{app_name}}</p>
{{email_footer}}
</body>
</html>

View File

@@ -0,0 +1,17 @@
{{email_header_text}}
{{greeting}}
Your access has been set up.
Username: {{username}}
Go to login:
{{login_url}}
If you do not know your password, you can reset it here:
{{reset_url}}
Best regards
{{app_name}}
{{email_footer_text}}

View File

@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<body style="font-family: Arial, sans-serif; line-height: 1.5; color: #111;">
{{email_header}}
<p>{{greeting}}</p>
<p>Thank you for registering! Please confirm your email address with the following code:</p>
<p style="font-size: 20px; font-weight: bold; letter-spacing: 2px;">{{code}}</p>
<p>This code is valid for {{expires_minutes}} minutes.</p>
<p>You can enter the code here:</p>
<p><a href="{{verify_url}}">{{verify_url}}</a></p>
<p>If you did not register, you can ignore this email.</p>
<p>Best regards<br>{{app_name}}</p>
{{email_footer}}
</body>
</html>

View File

@@ -0,0 +1,18 @@
{{email_header_text}}
{{greeting}}
Thank you for registering! Please confirm your email address with the following code:
Your code: {{code}}
This code is valid for {{expires_minutes}} minutes.
Enter the code here:
{{verify_url}}
If you did not register, you can ignore this email.
Best regards
{{app_name}}
{{email_footer_text}}

View File

@@ -0,0 +1,16 @@
</td>
</tr>
<tr>
<td style="padding:12px 24px 20px; border-top:1px solid #e6e6e6; font-size:12px; color:#555;">
<div style="margin-bottom:8px;">
<a href="{{imprint_url}}" style="color:#555; text-decoration:underline;">Imprint</a>
&nbsp;·&nbsp;
<a href="{{privacy_url}}" style="color:#555; text-decoration:underline;">Privacy</a>
</div>
{{app_name}} · This email was generated automatically.
</td>
</tr>
</table>
</td>
</tr>
</table>

View File

@@ -0,0 +1,2 @@
---
{{app_name}} · This email was generated automatically.

View File

@@ -0,0 +1,14 @@
<table role="presentation" width="100%" cellspacing="0" cellpadding="0" style="background:#f5f5f5; padding:24px 0;">
<tr>
<td align="center">
<table role="presentation" width="600" cellspacing="0" cellpadding="0" style="background:#ffffff; color:#111; border:1px solid #e6e6e6; border-radius:12px; width:100%; max-width:600px;">
<tr>
<td style="padding:20px 24px 12px; border-bottom:1px solid #e6e6e6;">
<div style="font-size:18px; font-weight:700; color:#111;">
<img src="{{app_logo_url}}" alt="{{app_name}}" height="32" style="display:inline-block; vertical-align:middle; margin-right:8px;">
<span style="vertical-align:middle;">{{app_name}}</span>
</div>
</td>
</tr>
<tr>
<td style="padding:16px 24px 4px;">

View File

@@ -0,0 +1,2 @@
{{app_name}}
=================

View File

@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<body style="font-family: Arial, sans-serif; line-height: 1.5; color: #111;">
{{email_header}}
<p>{{greeting}}</p>
<p>You requested a password reset code.</p>
<p style="font-size: 20px; font-weight: bold; letter-spacing: 2px;">{{code}}</p>
<p>This code is valid for {{expires_minutes}} minutes.</p>
<p>You can enter the code here:</p>
<p><a href="{{verify_url}}">{{verify_url}}</a></p>
<p>If you did not request this, you can ignore this email.</p>
<p>Best regards<br>{{app_name}}</p>
{{email_footer}}
</body>
</html>

View File

@@ -0,0 +1,18 @@
{{email_header_text}}
{{greeting}}
You requested a password reset code.
Your code: {{code}}
This code is valid for {{expires_minutes}} minutes.
Enter the code here:
{{verify_url}}
If you did not request this, you can ignore this email.
Best regards
{{app_name}}
{{email_footer_text}}

13
templates/error.phtml Normal file
View File

@@ -0,0 +1,13 @@
<?php
use MintyPHP\Buffer;
Buffer::start('html');
?>
<p style="color:red;">ERROR: <?php Buffer::get('html'); ?></p>
<?php
Buffer::end('html');
require __DIR__ . '/default.phtml';

49
templates/login.phtml Normal file
View File

@@ -0,0 +1,49 @@
<?php
use MintyPHP\Buffer;
$defaultTitle = appTitle();
$primaryVars = appPrimaryCssVars();
$theme = appDefaultTheme();
$user = $_SESSION['user'] ?? [];
?>
<!DOCTYPE html>
<html data-theme="<?php e($theme); ?>" <?php if ($primaryVars !== ''): ?>style="<?php e($primaryVars); ?>" <?php endif; ?>>
<head>
<base href="<?php e(localeBase()); ?>">
<script>
window.APP_ASSET_BASE = "<?php e(asset('')); ?>";
</script>
<title><?php e($defaultTitle); ?> <?php if (Buffer::get('title')); ?></title>
<meta property="og:site_name" content="<?php e($defaultTitle); ?>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/png" sizes="32x32" href="<?php e(appFaviconUrl('favicon-32x32.png')); ?>">
<link rel="icon" type="image/png" sizes="16x16" href="<?php e(appFaviconUrl('favicon-16x16.png')); ?>">
<link rel="apple-touch-icon" href="<?php e(appFaviconUrl('apple-touch-icon.png')); ?>">
<link rel="manifest" href="<?php e(asset('favicon/site.webmanifest')); ?>">
<link href="<?php e(asset('vendor/bootstrap-icons/bootstrap-icons.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/base/variables.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-badges.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/layout/app-shell.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-blockquote.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-forms.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-flash.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/components/app-brand.css')); ?>" rel="stylesheet">
<link href="<?php e(asset('css/pages/app-login.css')); ?>" rel="stylesheet">
</head>
<body>
<main>
<div class="container-small">
<?php require __DIR__ . '/partials/app-flash.phtml'; ?>
<?php Buffer::get('html'); ?>
</div>
</main>
<?php require __DIR__ . '/partials/app-footer.phtml'; ?>
<script type="module" src="<?php e(asset('js/app-login-init.js')); ?>"></script>
</body>
</html>

BIN
templates/partials/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,69 @@
<?php
$accountUrl = accountUrl();
$user = $_SESSION['user'] ?? [];
$accountName = trim((string) (($user['first_name'] ?? '') . ' ' . ($user['last_name'] ?? '')));
if ($accountName === '') {
$accountName = trim((string) ($user['email'] ?? ''));
}
$accountTooltip = $accountName !== '' ? $accountName : t('Account');
$hasAdminPanel = can('tenants.view') || can('departments.view') || can('users.view')
|| can('roles.view') || can('permissions.view') || can('settings.view')
|| can('mail_log.view') || can('stats.view');
$canViewAddressBook = can('address_book.view');
$addressBookUrl = lurl('address-book');
?>
<aside class="aside-icon-bar" data-aside-storage="app-sidebar-panel">
<nav>
<ul class="aside-icon-group" role="tablist">
<li>
<button type="button" id="aside-tab-explorer" data-aside-target="explorer" role="tab"
aria-selected="true" aria-controls="aside-panel-explorer" aria-label="<?php e(t('Explorer')); ?>"
data-tooltip="<?php e(t('Explorer')); ?>" data-tooltip-pos="right">
<i class="bi bi-house"></i>
</button>
</li>
<li>
<button type="button" id="aside-tab-search" data-aside-target="search" role="tab" aria-selected="false"
aria-controls="aside-panel-search" aria-label="<?php e(t('Search')); ?>"
data-tooltip="<?php e(t('Search')); ?>" data-tooltip-pos="right">
<i class="bi bi-search"></i>
</button>
</li>
<?php if ($canViewAddressBook): ?>
<li>
<button type="button" id="aside-tab-people" data-aside-target="people"
data-aside-href="<?php e($addressBookUrl); ?>" role="tab" aria-selected="false"
aria-controls="aside-panel-people" aria-label="<?php e(t('Address book')); ?>"
data-tooltip="<?php e(t('Address book')); ?>" data-tooltip-pos="right">
<i class="bi bi-people"></i>
</button>
</li>
<?php endif; ?>
<li>
<button type="button" id="aside-tab-files" data-aside-target="files" role="tab" aria-selected="false"
aria-controls="aside-panel-files" aria-label="<?php e(t('Files')); ?>"
data-tooltip="<?php e(t('Files')); ?>" data-tooltip-pos="right">
<i class="bi bi-folder"></i>
</button>
</li>
</ul>
<ul>
<?php if ($hasAdminPanel ?? true): ?>
<li>
<button type="button" id="aside-tab-admin" data-aside-target="admin" role="tab" aria-selected="false"
aria-controls="aside-panel-admin" aria-label="<?php e(t('Admin')); ?>"
data-tooltip="<?php e(t('Admin')); ?>" data-tooltip-pos="right">
<i class="bi bi-shield-lock"></i>
</button>
</li>
<?php endif; ?>
<li>
<a href="<?php e($accountUrl); ?>" aria-label="<?php e(t('Account')); ?>"
data-tooltip="<?php e($accountTooltip); ?>" data-tooltip-pos="right"><i
class="bi bi-person-circle"></i></a>
</li>
</ul>
</nav>
</aside>

View File

@@ -0,0 +1,399 @@
<?php
use MintyPHP\Service\TenantAvatarService;
$canViewTenants = can('tenants.view');
$canViewDepartments = can('departments.view');
$canViewUsers = can('users.view');
$canViewRoles = can('roles.view');
$canViewPermissions = can('permissions.view');
$canViewSettings = can('settings.view');
$canViewMailLog = can('mail_log.view');
$canViewStats = can('stats.view');
$canViewAddressBook = can('address_book.view');
$hasOrganization = $canViewTenants || $canViewDepartments || $canViewUsers;
$hasUsersSection = $canViewRoles || $canViewPermissions || $canViewSettings;
$hasSystemSection = $canViewStats || $canViewMailLog || $canViewSettings;
$hasAdminPanel = $hasOrganization || $hasUsersSection || $hasSystemSection;
// Declarative nav config for admin panel
$navSections = [
[
'label' => '',
'visible' => $hasOrganization,
'items' => [
[
'label' => t('Tenants'),
'path' => 'admin/tenants',
'active' => navActive('admin/tenants', true),
'visible' => $canViewTenants,
'withTenant' => false,
],
[
'label' => t('Departments'),
'path' => 'admin/departments',
'active' => navActive('admin/departments', true),
'visible' => $canViewDepartments,
'withTenant' => true,
],
[
'label' => t('Users'),
'path' => 'admin/users',
'active' => navActive('admin/users', true),
'visible' => $canViewUsers,
'withTenant' => true,
],
],
],
[
'label' => t('Roles & permissions'),
'visible' => $hasUsersSection,
'items' => [
[
'label' => t('Roles'),
'path' => 'admin/roles',
'active' => navActive('admin/roles', true),
'visible' => $canViewRoles,
'withTenant' => false,
],
[
'label' => t('Permissions'),
'path' => 'admin/permissions',
'active' => navActive('admin/permissions', true),
'visible' => $canViewPermissions,
'withTenant' => false,
],
],
],
[
'label' => t('System'),
'visible' => $hasSystemSection,
'items' => [
[
'label' => t('Statistics'),
'path' => 'admin/stats',
'active' => navActive('admin/stats', true),
'visible' => $canViewStats,
'withTenant' => false,
],
[
'label' => t('Mail logs'),
'path' => 'admin/mail-log',
'active' => navActive('admin/mail-log', true),
'visible' => $canViewMailLog,
'withTenant' => false,
],
[
'label' => t('Settings'),
'path' => 'admin/settings',
'active' => navActive('admin/settings', true),
'visible' => $canViewSettings,
'withTenant' => false,
],
],
],
];
// Render helper for admin sections
$renderNavSection = static function (array $section, string $tenantQueryParam): void {
if (empty($section['visible'])) {
return;
}
$items = $section['items'] ?? [];
$items = array_values(array_filter($items, static fn ($item) => !empty($item['visible'])));
if (!$items) {
return;
}
?>
<?php if (!empty($section['label'])): ?>
<small><?php e($section['label']); ?></small>
<?php endif; ?>
<?php foreach ($items as $item): ?>
<?php
$href = $item['path'] ?? '';
if ($href !== '' && !empty($item['withTenant'])) {
$href .= $tenantQueryParam;
}
$active = $item['active'] ?? ['class' => '', 'aria' => ''];
?>
<li>
<a href="<?php e($href); ?>" class="<?php e($active['class'] ?? ''); ?>" <?php echo $active['aria'] ?? ''; ?>>
<?php e($item['label'] ?? ''); ?>
</a>
</li>
<?php endforeach; ?>
<?php
};
// Load tenant context from session (no DB calls allowed in templates)
$currentTenant = $_SESSION['current_tenant'] ?? null;
$currentTenantId = $currentTenant['id'] ?? null;
$availableTenants = $_SESSION['available_tenants'] ?? [];
// Add tenant filter to links when user has multiple tenants
$tenantQueryParam = '';
if (count($availableTenants) > 1 && !empty($currentTenant['uuid'])) {
$tenantQueryParam = '?tenant=' . urlencode($currentTenant['uuid']);
}
// Tenant logo display (without switcher - switcher is now in topbar)
$tenantUuid = $currentTenant['uuid'] ?? '';
$tenantName = $currentTenant['description'] ?? '';
$hasTenantAvatar = $tenantUuid && TenantAvatarService::hasAvatar($tenantUuid);
$addressBookUrl = lurl('address-book');
$activeAddressTenants = array_filter(array_map('trim', explode(',', (string) ($_GET['tenants'] ?? ''))));
$activeAddressDepartments = array_filter(array_map('intval', explode(',', (string) ($_GET['departments'] ?? ''))));
$peopleGroups = $_SESSION['available_departments_by_tenant'] ?? [];
?>
<aside class="app-sidebar" id="app-sidebar">
<?php if ($currentTenant): ?>
<div class="app-sidebar-tenant-logo">
<a href="/">
<?php if ($hasTenantAvatar): ?>
<img src="admin/tenants/avatar-file?uuid=<?php e($tenantUuid); ?>&size=128" alt="<?php e($tenantName); ?>"
title="<?php e($tenantName); ?>">
<?php else: ?>
<div class="app-sidebar-tenant-name">
<i class="bi bi-buildings"></i> <?php e($tenantName); ?>
</div>
<?php endif; ?>
</a>
</div>
<?php endif; ?>
<div class="app-sidebar-titlebar">
<div class="app-sidebar-title" data-aside-title-default="<?php e(t('Explorer')); ?>">
<?php e(t('Explorer')); ?>
</div>
<div class="app-sidebar-tools" data-aside-tools></div>
</div>
<div id="app-sidebar-panels" class="app-sidebar-panels">
<nav id="aside-panel-explorer" class="app-sidebar-panel" data-aside-panel="explorer"
data-aside-title="<?php e(t('Explorer')); ?>" role="tabpanel" aria-labelledby="aside-tab-explorer"
aria-label="<?php e(t('Primary navigation')); ?>">
<ul>
<li>
<?php $home = navActive(['', 'admin'], false); ?>
<a href="<?php e(lurl('')); ?>" class="<?php e($home['class']); ?>" <?php echo $home['aria']; ?>>
<?php e(t('Home')); ?>
</a>
</li>
</ul>
<div class="app-sidebar-panel-tools" data-aside-panel-tools hidden>
<!-- <button type="button" class="icon-button" aria-label="<?php e(t('Add')); ?>">
<i class="bi bi-plus-lg"></i>
</button> -->
</div>
</nav>
<?php if ($hasAdminPanel): ?>
<nav id="aside-panel-admin" class="app-sidebar-panel" data-aside-panel="admin"
data-aside-title="<?php e(t('Admin')); ?>" role="tabpanel" aria-labelledby="aside-tab-admin" hidden>
<ul>
<?php foreach ($navSections as $section): ?>
<?php $renderNavSection($section, $tenantQueryParam); ?>
<?php endforeach; ?>
</ul>
<div class="app-sidebar-panel-tools" data-aside-panel-tools hidden></div>
</nav>
<?php endif; ?>
<?php if ($canViewAddressBook): ?>
<?php $addressBookActive = navActive('address-book', true); ?>
<nav id="aside-panel-people" class="app-sidebar-panel" data-aside-panel="people"
data-aside-details-storage="aside-people-tenant"
data-aside-title="<?php e(t('Address book')); ?>" role="tabpanel" aria-labelledby="aside-tab-people" hidden>
<ul>
<?php if (!$peopleGroups): ?>
<li>
<a href="<?php e($addressBookUrl); ?>" class="<?php e($addressBookActive['class'] ?? ''); ?>"
<?php echo $addressBookActive['aria'] ?? ''; ?>>
<?php e(t('Address book')); ?>
</a>
</li>
<?php else: ?>
<?php
$allPeopleActive = $addressBookActive['isActive'] && !$activeAddressTenants && !$activeAddressDepartments;
?>
<?php foreach ($peopleGroups as $index => $group): ?>
<?php
$tenant = $group['tenant'] ?? [];
$departments = $group['departments'] ?? [];
$tenantUuid = (string) ($tenant['uuid'] ?? '');
$tenantName = (string) ($tenant['description'] ?? '');
if ($tenantUuid === '') {
continue;
}
$baseHref = $addressBookUrl . '?tenants=' . urlencode($tenantUuid);
$isActiveTenant = $addressBookActive['isActive']
&& !$activeAddressDepartments
&& count($activeAddressTenants) === 1
&& $activeAddressTenants[0] === $tenantUuid;
?>
<li class="app-sidebar-group">
<details data-details-key="<?php e($tenantUuid); ?>" <?php echo $index === 0 ? 'open' : ''; ?>>
<summary>
<span>
<?php e($tenantName); ?>
</span>
</summary>
<ul>
<li>
<a href="<?php e($baseHref); ?>" class="<?php e($isActiveTenant ? 'active' : ''); ?>"
<?php echo $isActiveTenant ? 'aria-current="page"' : ''; ?>>
<small><?php e(t('All people')); ?></small>
</a>
</li>
<?php foreach ($departments as $department): ?>
<?php
$departmentId = (int) ($department['id'] ?? 0);
if ($departmentId <= 0) {
continue;
}
$departmentName = (string) ($department['description'] ?? '');
$href = $baseHref . '&departments=' . $departmentId;
$isActive = $addressBookActive['isActive']
&& in_array($tenantUuid, $activeAddressTenants, true)
&& in_array($departmentId, $activeAddressDepartments, true);
?>
<li>
<a href="<?php e($href); ?>" class="<?php e($isActive ? 'active' : ''); ?>"
<?php echo $isActive ? 'aria-current="page"' : ''; ?>>
<small>
<?php e($departmentName); ?>
</small>
</a>
</li>
<?php endforeach; ?>
</ul>
</details>
<hr>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
<div class="app-sidebar-panel-tools" data-aside-panel-tools hidden></div>
</nav>
<?php endif; ?>
<div id="aside-panel-search" class="app-sidebar-panel" data-aside-panel="search"
data-aside-title="<?php e(t('Search')); ?>" role="tabpanel" aria-labelledby="aside-tab-search" hidden>
<form class="app-search">
<input type="search" name="side-search" id="side-search" placeholder="<?php e(t('Search...')); ?>"
aria-label="<?php e(t('Search')); ?>">
</form>
<nav id="global-search">
<ul class="app-search-results" data-global-search-results>
<?php if (can('users.view')): ?>
<?php $usersSearch = navActive('admin/users', true); ?>
<li data-search-key="users" data-search-base="<?php e(lurl('admin/users')); ?>">
<a href="<?php e(lurl('admin/users')); ?>" class="<?php e($usersSearch['class']); ?>" <?php echo $usersSearch['aria']; ?>>
<span><?php e(t('Users')); ?></span>
<span class="badge" data-search-count>0</span>
</a>
<ul class="app-search-preview" data-search-preview></ul>
</li>
<?php endif; ?>
<?php if ($canViewAddressBook): ?>
<?php $addressBookSearch = navActive('address-book', true); ?>
<li data-search-key="address-book" data-search-base="<?php e(lurl('address-book')); ?>">
<a href="<?php e(lurl('address-book')); ?>" class="<?php e($addressBookSearch['class'] ?? ''); ?>"
<?php echo $addressBookSearch['aria'] ?? ''; ?>>
<span><?php e(t('Address book')); ?></span>
<span class="badge" data-search-count>0</span>
</a>
<ul class="app-search-preview" data-search-preview></ul>
</li>
<?php endif; ?>
<?php if (can('tenants.view')): ?>
<?php $tenantsSearch = navActive('admin/tenants', true); ?>
<li data-search-key="tenants" data-search-base="<?php e(lurl('admin/tenants')); ?>">
<a href="<?php e(lurl('admin/tenants')); ?>" class="<?php e($tenantsSearch['class']); ?>" <?php echo $tenantsSearch['aria']; ?>>
<span><?php e(t('Tenants')); ?></span>
<span class="badge" data-search-count>0</span>
</a>
<ul class="app-search-preview" data-search-preview></ul>
</li>
<?php endif; ?>
<?php if (can('departments.view')): ?>
<?php $departmentsSearch = navActive('admin/departments', true); ?>
<li data-search-key="departments" data-search-base="<?php e(lurl('admin/departments')); ?>">
<a href="<?php e(lurl('admin/departments')); ?>"
class="<?php e($departmentsSearch['class']); ?>" <?php echo $departmentsSearch['aria']; ?>>
<span><?php e(t('Departments')); ?></span>
<span class="badge" data-search-count>0</span>
</a>
<ul class="app-search-preview" data-search-preview></ul>
</li>
<?php endif; ?>
<?php if (can('roles.view')): ?>
<?php $rolesSearch = navActive('admin/roles', true); ?>
<li data-search-key="roles" data-search-base="<?php e(lurl('admin/roles')); ?>">
<a href="<?php e(lurl('admin/roles')); ?>" class="<?php e($rolesSearch['class']); ?>" <?php echo $rolesSearch['aria']; ?>>
<span><?php e(t('Roles')); ?></span>
<span class="badge" data-search-count>0</span>
</a>
<ul class="app-search-preview" data-search-preview></ul>
</li>
<?php endif; ?>
<?php if (can('permissions.view')): ?>
<?php $permissionsSearch = navActive('admin/permissions', true); ?>
<li data-search-key="permissions" data-search-base="<?php e(lurl('admin/permissions')); ?>">
<a href="<?php e(lurl('admin/permissions')); ?>"
class="<?php e($permissionsSearch['class']); ?>" <?php echo $permissionsSearch['aria']; ?>>
<span><?php e(t('Permissions')); ?></span>
<span class="badge" data-search-count>0</span>
</a>
<ul class="app-search-preview" data-search-preview></ul>
</li>
<?php endif; ?>
<?php
$pagesSearch = navActivePublicPages();
?>
<li data-search-key="pages" data-search-base="<?php e(lurl('')); ?>">
<a href="<?php e(lurl('')); ?>" class="<?php e($pagesSearch['class']); ?>" <?php echo $pagesSearch['aria']; ?>>
<span><?php e(t('Pages')); ?></span>
<span class="badge" data-search-count>0</span>
</a>
<ul class="app-search-preview" data-search-preview></ul>
</li>
<?php if (can('settings.view')): ?>
<?php $settingsSearch = navActive('admin/settings', true); ?>
<li data-search-key="settings" data-search-base="<?php e(lurl('admin/settings')); ?>">
<a href="<?php e(lurl('admin/settings')); ?>" class="<?php e($settingsSearch['class']); ?>"
<?php echo $settingsSearch['aria']; ?>>
<span><?php e(t('Settings')); ?></span>
<span class="badge" data-search-count>0</span>
</a>
</li>
<?php endif; ?>
</ul>
</nav>
<div class="app-sidebar-panel-tools" data-aside-panel-tools hidden>
<button type="button" class="icon-button" data-tooltip="<?php e(t('Toggle search details')); ?>"
data-tooltip-pos="bottom" aria-label="<?php e(t('Toggle search details')); ?>"
data-search-details-toggle>
<i class="bi bi-dash-square" data-search-details-icon></i>
</button>
</div>
</div>
<nav id="aside-panel-files" class="app-sidebar-panel" data-aside-panel="files"
data-aside-title="<?php e(t('Files')); ?>" role="tabpanel" aria-labelledby="aside-tab-files" hidden>
<ul>
<li>
<a href="#"><?php e(t('All files')); ?></a>
</li>
<li>
<a href="#"><?php e(t('My files')); ?></a>
</li>
<li>
<a href="#"><?php e(t('Shared with me')); ?></a>
</li>
</ul>
<div class="app-sidebar-panel-tools" data-aside-panel-tools hidden>
<button type="button" class="icon-button" aria-label="<?php e(t('New folder')); ?>">
<i class="bi bi-folder-plus"></i>
</button>
</div>
</nav>
</div>
</aside>

View File

@@ -0,0 +1,34 @@
<?php
use MintyPHP\Support\Flash;
use MintyPHP\Http\Request;
use MintyPHP\Session;
$messages = Flash::peek(Request::path());
if (!$messages) {
return;
}
$returnTarget = Request::pathWithQuery();
$timeouts = [
'success' => 5000,
'info' => 6000,
'warning' => 7000,
'error' => 0,
];
?>
<div class="flash-stack">
<?php foreach ($messages as $message) : ?>
<?php $type = $message['type'] ?? 'info'; ?>
<?php $timeout = $timeouts[$type] ?? 5000; ?>
<div class="notice" data-variant="<?php e($type); ?>" data-flash-timeout="<?php e($timeout); ?>">
<?php e(t($message['message'] ?? '')); ?>
<form method="post" action="flash/dismiss/<?php e($message['id'] ?? ''); ?>">
<input type="hidden" name="return" value="<?php e($returnTarget); ?>">
<button type="submit" class="contrast outline small"><i class="bi bi-x"></i></button>
<?php Session::getCsrfInput(); ?>
</form>
</div>
<?php endforeach; ?>
</div>

View File

@@ -0,0 +1,24 @@
<footer class="site-footer">
<nav>
<ul>
<li>
<a href="/">
<span class="muted">©
<?php e(date('Y')); ?> IMVS
</span>
</a>
</li>
<li><a href="imprint">Impressum</a></li>
<li><a href="privacy">Datenschutz</a></li>
</ul>
<ul>
<li>
<?php
$variant = 'select';
require __DIR__ . '/app-language-switcher.phtml';
unset($variant);
?>
</li>
</ul>
</nav>
</footer>

View File

@@ -0,0 +1,66 @@
<?php
use MintyPHP\I18n;
use MintyPHP\Http\Request;
$locales = defined('APP_LOCALES') ? APP_LOCALES : [I18n::$defaultLocale];
$returnTarget = Request::pathWithQuery();
$variant = $variant ?? 'select';
$baseUrl = lurl('lang');
$isLoggedIn = !empty($_SESSION['user']['id']);
$publicTarget = Request::stripLocale($returnTarget);
$publicTarget = ltrim($publicTarget, '/');
$base = \MintyPHP\Router::getBaseUrl();
$base = rtrim($base, '/');
$publicTarget = ltrim($publicTarget, '/');
?>
<?php if ($variant === 'dropdown'): ?>
<details class="dropdown">
<summary>
<i class="bi bi-translate"></i>
</summary>
<ul dir="rtl">
<?php foreach ($locales as $locale): ?>
<?php
$isActive = $locale === I18n::$locale;
$label = strtoupper((string) $locale);
$publicUrl = $base . '/' . $locale . ($publicTarget !== '' ? '/' . $publicTarget : '');
$switchUrl = $isLoggedIn
? ($baseUrl . '?locale=' . $locale . '&return=' . urlencode($returnTarget))
: $publicUrl;
?>
<li dir="ltr">
<a href="<?php e($switchUrl); ?>"
<?php if ($isActive) { ?>aria-current="true"<?php } ?>>
<?php e($label); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</details>
<?php else: ?>
<?php if ($isLoggedIn): ?>
<form class="nav nav--lang" method="get" action="<?php e($baseUrl); ?>" aria-label="Language switcher">
<input type="hidden" name="return" value="<?php e($returnTarget); ?>">
<select class="lang-select" name="locale" onchange="this.form.submit()">
<?php foreach ($locales as $locale): ?>
<option value="<?php e($locale); ?>" <?php if ($locale === I18n::$locale) { ?>selected<?php } ?>>
<?php e(strtoupper((string) $locale)); ?>
</option>
<?php endforeach; ?>
</select>
</form>
<?php else: ?>
<div class="nav nav--lang" role="listbox" aria-label="Language switcher">
<?php foreach ($locales as $locale): ?>
<?php
$publicUrl = $base . '/' . $locale . ($publicTarget !== '' ? '/' . $publicTarget : '');
?>
<a href="<?php e($publicUrl); ?>" class="lang-link"
<?php if ($locale === I18n::$locale) { ?>aria-current="true"<?php } ?>>
<?php e(strtoupper((string) $locale)); ?>
</a>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php endif; ?>

View File

@@ -0,0 +1,44 @@
<?php
/**
* @var string $href
* @var string $label
* @var string|null $count
* @var string|null $icon
* @var string|null $iconBg
* @var string|null $iconColor
* @var string|null $class
*/
$href = $href ?? '#';
$label = $label ?? '';
$count = $count ?? null;
$icon = $icon ?? 'bi bi-grid-1x2';
$iconBg = $iconBg ?? null;
$iconColor = $iconColor ?? null;
$class = $class ?? '';
$styleParts = [];
if ($iconBg) {
$styleParts[] = '--tile-icon-bg:' . $iconBg;
}
if ($iconColor) {
$styleParts[] = '--tile-icon-color:' . $iconColor;
}
$style = $styleParts ? implode(';', $styleParts) . ';' : '';
?>
<a class="app-tile<?php echo $class ? ' ' . $class : ''; ?>" href="<?php e($href); ?>" <?php if ($style) : ?>style="<?php e($style); ?>"<?php endif; ?>>
<span class="app-tile-icon">
<i class="<?php e($icon); ?>" aria-hidden="true"></i>
</span>
<?php if ($count !== null && $count !== '') : ?>
<span class="app-tile-count"><?php e($count); ?></span>
<?php endif; ?>
<?php if ($label !== '') : ?>
<span class="app-tile-label"><?php e($label); ?></span>
<?php endif; ?>
<span class="app-tile-link" aria-hidden="true">
<i class="bi bi-box-arrow-up-right"></i>
</span>
</a>

View File

@@ -0,0 +1,106 @@
<?php
use MintyPHP\Session;
$user = $_SESSION['user'] ?? [];
$accountUrl = accountUrl();
$theme = 'light';
$userTheme = strtolower(trim((string) ($user['theme'] ?? '')));
if (in_array($userTheme, ['light', 'dark'], true)) {
$theme = $userTheme;
}
$themeIcon = $theme === 'dark' ? 'bi-moon-stars-fill' : 'bi-sun-fill';
$csrfKey = Session::$csrfSessionKey;
$csrfToken = $_SESSION[$csrfKey] ?? '';
// Tenant switcher data
$currentTenant = $_SESSION['current_tenant'] ?? null;
$currentTenantId = $currentTenant['id'] ?? null;
$availableTenants = $_SESSION['available_tenants'] ?? [];
?>
<header class="app-header">
<nav>
<ul>
<li>
<a id="global-back" data-tooltip-pos="bottom" data-tooltip="<?php e(t('Back')); ?>" title="<?php e(t('Back')); ?>" href="admin"><i class="bi bi-arrow-left"></i></a>
</li>
<li>
<a id="global-forward" data-tooltip-pos="bottom" data-tooltip="<?php e(t('Forward')); ?>" title="<?php e(t('Forward')); ?>" href="admin"><i class="bi bi-arrow-right"></i></a>
</li>
<li id="async-messages"></li>
</ul>
<ul class="nav-list">
<li data-tooltip="<?php e(t("Toggle Sidebar"));?>" data-tooltip-pos="bottom">
<button id="toggle-aside"><i class="bi bi-layout-sidebar-inset"></i></button>
</li>
<li data-tooltip="<?php e(t("Toggle Detail Sidebar"));?>" data-tooltip-pos="bottom">
<button id="toggle-main-content-aside"><i class="bi bi-layout-sidebar-inset-reverse"></i></button>
</li>
<?php if (allowUserTheme()): ?>
<li data-tooltip="<?php e(t("Theme"));?>" data-tooltip-pos="bottom">
<button
type="button"
class="theme-toggle"
data-theme-toggle
data-theme-url="admin/users/theme"
data-csrf-key="<?php e($csrfKey); ?>"
data-csrf-token="<?php e($csrfToken); ?>"
aria-label="<?php e(t('Toggle theme')); ?>"
>
<i class="bi <?php e($themeIcon); ?>"></i>
</button>
</li>
<?php endif; ?>
<?php if ($currentTenant && count($availableTenants) > 1): ?>
<li data-tooltip="<?php e(t('Switch tenant')); ?>" data-tooltip-pos="bottom">
<details class="dropdown">
<summary><i class="bi bi-buildings"></i></summary>
<ul dir="rtl">
<?php foreach ($availableTenants as $tenant): ?>
<?php $isActive = ($tenant['id'] ?? 0) === $currentTenantId; ?>
<li>
<a href="#"
class="<?php echo $isActive ? 'active' : ''; ?>"
<?php if (!$isActive): ?>
data-switch-tenant="<?php e($tenant['id'] ?? ''); ?>"
data-csrf-key="<?php e($csrfKey); ?>"
data-csrf-token="<?php e($csrfToken); ?>"
data-error-message="<?php e(t('Failed to switch tenant')); ?>"
<?php endif; ?>>
<?php e($tenant['description'] ?? ''); ?>
<?php if ($isActive): ?>
<i class="bi bi-check"></i>
<?php endif; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</details>
</li>
<?php endif; ?>
<li>
<?php
$variant = 'dropdown';
require __DIR__ . '/app-language-switcher.phtml';
unset($variant);
?>
</li>
<li>
<details class="dropdown">
<summary><i class="bi bi-person-fill"></i></summary>
<ul dir="rtl">
<li><a href="<?php e($accountUrl); ?>">
<?php e(t('Account')); ?>
</a>
</li>
<li><a href="logout">
<?php e(t('Logout')); ?>
</a>
</li>
</ul>
</details>
</li>
</ul>
</nav>
</header>