big restructure

This commit is contained in:
2026-02-11 19:28:12 +01:00
parent cd59ccd99b
commit 3eb9cc0ac4
209 changed files with 5101 additions and 2459 deletions

View File

@@ -1,10 +1,6 @@
<?php
$accountUrl = accountUrl();
$user = $_SESSION['user'] ?? [];
$accountName = trim((string) (($user['first_name'] ?? '') . ' ' . ($user['last_name'] ?? '')));
if ($accountName === '') {
$accountName = trim((string) ($user['email'] ?? ''));
}
$accountName = currentUserDisplayName();
$accountTooltip = $accountName !== '' ? $accountName : t('Account');
$hasAdminPanel = can('tenants.view') || can('departments.view') || can('users.view')
|| can('roles.view') || can('permissions.view') || can('settings.view')
@@ -59,7 +55,7 @@ $addressBookUrl = lurl('address-book');
<?php endif; ?>
<li>
<a href="<?php e($accountUrl); ?>" aria-label="<?php e(t('Account')); ?>"
data-tooltip="<?php e($accountTooltip); ?>" data-tooltip-pos="right"><i
data-tooltip="<?php e($accountTooltip); ?>" data-tooltip-pos="right" data-aside-shortcut="account"><i
class="bi bi-person-circle"></i></a>
</li>

View File

@@ -1,6 +1,6 @@
<?php
use MintyPHP\Service\TenantAvatarService;
use MintyPHP\Service\Tenant\TenantAvatarService;
$canViewTenants = can('tenants.view');
$canViewDepartments = can('departments.view');
@@ -106,7 +106,7 @@ $renderNavSection = static function (array $section, string $tenantQueryParam):
}
?>
<?php if (!empty($section['label'])): ?>
<small><?php e($section['label']); ?></small>
<small class="muted"><?php e($section['label']); ?></small>
<?php endif; ?>
<?php foreach ($items as $item): ?>
<?php
@@ -158,14 +158,12 @@ $peopleGroups = $_SESSION['available_departments_by_tenant'] ?? [];
</div>
<?php endif; ?>
</a>
<button type="button" class="app-sidebar-tenant-toggle" data-sidebar-toggle
aria-label="<?php e(t('Toggle Sidebar')); ?>">
<i class="bi bi-list"></i>
</button>
</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"
@@ -178,11 +176,6 @@ $peopleGroups = $_SESSION['available_departments_by_tenant'] ?? [];
</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"
@@ -192,7 +185,6 @@ $peopleGroups = $_SESSION['available_departments_by_tenant'] ?? [];
<?php $renderNavSection($section, $tenantQueryParam); ?>
<?php endforeach; ?>
</ul>
<div class="app-sidebar-panel-tools" data-aside-panel-tools hidden></div>
</nav>
<?php endif; ?>
@@ -229,17 +221,14 @@ $peopleGroups = $_SESSION['available_departments_by_tenant'] ?? [];
&& $activeAddressTenants[0] === $tenantUuid;
?>
<li class="app-sidebar-group">
<details data-details-key="<?php e($tenantUuid); ?>" <?php echo $index === 0 ? 'open' : ''; ?>>
<summary>
<span>
<small class="muted">
<?php e($tenantName); ?>
</span>
</summary>
</small>
<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>
<?php e(t('All people')); ?>
</a>
</li>
<?php foreach ($departments as $department): ?>
@@ -257,20 +246,18 @@ $peopleGroups = $_SESSION['available_departments_by_tenant'] ?? [];
<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; ?>
@@ -367,13 +354,6 @@ $peopleGroups = $_SESSION['available_departments_by_tenant'] ?? [];
<?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"

View File

@@ -0,0 +1,31 @@
<?php
$breadcrumbs = $breadcrumbs ?? [];
$items = array_values(array_filter($breadcrumbs, static function ($item) {
return !empty($item['label']);
}));
if (!$items) {
return;
}
$lastIndex = count($items) - 1;
?>
<div class="app-breadcrumb">
<?php foreach ($items as $index => $item): ?>
<?php
$label = (string) ($item['label'] ?? '');
$href = (string) ($item['href'] ?? '');
$path = (string) ($item['path'] ?? '');
$isLast = $index === $lastIndex;
if ($href === '' && $path !== '') {
$href = lurl($path);
}
?>
<?php if ($href !== '' && !$isLast): ?>
<a href="<?php e($href); ?>"><?php e($label); ?></a>
<?php else: ?>
<span<?php if ($isLast): ?> aria-current="page"<?php endif; ?>><?php e($label); ?></span>
<?php endif; ?>
<?php if (!$isLast): ?>
<i class="bi bi-chevron-right"></i>
<?php endif; ?>
<?php endforeach; ?>
</div>

View File

@@ -1,15 +1,15 @@
<footer class="site-footer">
<nav>
<ul>
<li>
<a href="/">
<li>
<a href="<?php e(lurl('')); ?>">
<span class="muted">©
<?php e(date('Y')); ?> IMVS
<?php e(date('Y')); ?> <?php e(appTitle()); ?>
</span>
</a>
</li>
<li><a href="imprint">Impressum</a></li>
<li><a href="privacy">Datenschutz</a></li>
<li><a href="<?php e(lurl('imprint')); ?>"><?php e(t('Imprint')); ?></a></li>
<li><a href="<?php e(lurl('privacy')); ?>"><?php e(t('Privacy')); ?></a></li>
</ul>
<ul>
<li>

View File

@@ -8,6 +8,8 @@
* @var string|null $iconBg
* @var string|null $iconColor
* @var string|null $class
* @var string|null $tooltip
* @var string|null $tooltipPos
*/
$href = $href ?? '#';
@@ -17,6 +19,8 @@ $icon = $icon ?? 'bi bi-grid-1x2';
$iconBg = $iconBg ?? null;
$iconColor = $iconColor ?? null;
$class = $class ?? '';
$tooltip = $tooltip ?? '';
$tooltipPos = $tooltipPos ?? 'top';
$styleParts = [];
if ($iconBg) {
@@ -28,7 +32,12 @@ if ($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; ?>>
<a
class="app-tile<?php echo $class ? ' ' . $class : ''; ?>"
href="<?php e($href); ?>"
<?php if ($style) : ?>style="<?php e($style); ?>"<?php endif; ?>
<?php if ($tooltip !== '') : ?>data-tooltip="<?php e($tooltip); ?>" data-tooltip-pos="<?php e($tooltipPos); ?>"<?php endif; ?>
>
<span class="app-tile-icon">
<i class="<?php e($icon); ?>" aria-hidden="true"></i>
</span>

View File

@@ -4,12 +4,11 @@ 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';
$userUuid = trim((string) ($user['uuid'] ?? ''));
$accountEditUrl = $userUuid !== '' ? lurl("admin/users/edit/{$userUuid}") : $accountUrl;
$themes = appThemes();
$theme = currentTheme();
$themeIcon = str_starts_with($theme, 'dark') ? 'bi-moon-stars-fill' : 'bi-sun-fill';
$csrfKey = Session::$csrfSessionKey;
$csrfToken = $_SESSION[$csrfKey] ?? '';
@@ -23,35 +22,50 @@ $availableTenants = $_SESSION['available_tenants'] ?? [];
<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>
<a id="global-back" data-tooltip-pos="bottom" data-tooltip="<?php e(t('Back')); ?> (Alt+←)" title="<?php e(t('Back')); ?> (Alt+←)" 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>
<a id="global-forward" data-tooltip-pos="bottom" data-tooltip="<?php e(t('Forward')); ?> (Alt+→)" title="<?php e(t('Forward')); ?> (Alt+→)" 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>
<button id="toggle-aside" data-sidebar-toggle data-sidebar-action="visibility"><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
<li data-tooltip="<?php e(t('Theme')); ?>" data-tooltip-pos="bottom">
<details class="dropdown"
data-theme-menu
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>
data-csrf-token="<?php e($csrfToken); ?>">
<summary aria-label="<?php e(t('Toggle theme')); ?>">
<i class="bi <?php e($themeIcon); ?>" data-theme-icon></i>
</summary>
<ul dir="rtl">
<?php foreach ($themes as $key => $label): ?>
<?php $isActiveTheme = $key === $theme; ?>
<li>
<a href="#" data-theme-option data-theme-value="<?php e($key); ?>"
class="<?php e($isActiveTheme ? 'active' : ''); ?>"
<?php echo $isActiveTheme ? 'aria-current="true"' : ''; ?>>
<?php e(t($label)); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</details>
</li>
<?php endif; ?>
<li data-tooltip="<?php e(t('High contrast')); ?>" data-tooltip-pos="bottom">
<button type="button" data-contrast-toggle aria-label="<?php e(t('Toggle contrast')); ?>">
<i class="bi bi-circle-half"></i>
</button>
</li>
<?php if ($currentTenant && count($availableTenants) > 1): ?>
<li data-tooltip="<?php e(t('Switch tenant')); ?>" data-tooltip-pos="bottom">
<details class="dropdown">
@@ -90,10 +104,26 @@ $availableTenants = $_SESSION['available_tenants'] ?? [];
<details class="dropdown">
<summary><i class="bi bi-person-fill"></i></summary>
<ul dir="rtl">
<li><a href="<?php e($accountUrl); ?>">
<li><a href="<?php e($accountEditUrl); ?>">
<?php e(t('Account')); ?>
</a>
</li>
<li><a href="<?php e($accountEditUrl . '?tab=profile'); ?>">
<?php e(t('Profile')); ?>
</a>
</li>
<li><a href="<?php e($accountEditUrl . '?tab=masterdata'); ?>">
<?php e(t('Master data')); ?>
</a>
</li>
<li><a href="<?php e($accountEditUrl . '?tab=access'); ?>">
<?php e(t('Access & password')); ?>
</a>
</li>
<li><a href="<?php e(lurl('help/hotkeys')); ?>">
<?php e(t('Keyboard shortcuts')); ?>
</a>
</li>
<li><a href="logout">
<?php e(t('Logout')); ?>
</a>