2026-02-04 23:31:53 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use MintyPHP\Session;
|
|
|
|
|
|
|
|
|
|
$user = $_SESSION['user'] ?? [];
|
|
|
|
|
$accountUrl = accountUrl();
|
2026-02-11 19:28:12 +01:00
|
|
|
$userUuid = trim((string) ($user['uuid'] ?? ''));
|
|
|
|
|
$accountEditUrl = $userUuid !== '' ? lurl("admin/users/edit/{$userUuid}") : $accountUrl;
|
|
|
|
|
$themes = appThemes();
|
|
|
|
|
$theme = currentTheme();
|
2026-02-04 23:31:53 +01:00
|
|
|
$csrfKey = Session::$csrfSessionKey;
|
|
|
|
|
$csrfToken = $_SESSION[$csrfKey] ?? '';
|
|
|
|
|
|
2026-04-06 22:21:39 +02:00
|
|
|
// Tenant branding data (from $layoutNav, same source as app-main-aside.phtml)
|
|
|
|
|
$layoutNav = is_array($layoutNav ?? null) ? $layoutNav : [];
|
|
|
|
|
$tenantAvatar = is_array($layoutNav['tenantAvatar'] ?? null) ? $layoutNav['tenantAvatar'] : [];
|
|
|
|
|
$brandTenantUuid = trim((string) ($tenantAvatar['uuid'] ?? ''));
|
|
|
|
|
$brandTenantName = trim((string) ($tenantAvatar['name'] ?? ''));
|
|
|
|
|
$brandHasTenantAvatar = !empty($tenantAvatar['hasAvatar']);
|
|
|
|
|
|
2026-02-04 23:31:53 +01:00
|
|
|
// Tenant switcher data
|
|
|
|
|
$currentTenant = $_SESSION['current_tenant'] ?? null;
|
2026-03-05 12:51:53 +01:00
|
|
|
$currentTenantId = (int) ($currentTenant['id'] ?? 0);
|
2026-02-04 23:31:53 +01:00
|
|
|
$availableTenants = $_SESSION['available_tenants'] ?? [];
|
2026-03-05 12:51:53 +01:00
|
|
|
$tenantLabel = trim((string) ($currentTenant['description'] ?? ''));
|
|
|
|
|
if ($tenantLabel === '') {
|
|
|
|
|
$tenantLabel = t('None');
|
|
|
|
|
}
|
|
|
|
|
$canSwitchTenant = is_array($currentTenant) && count($availableTenants) > 1;
|
|
|
|
|
$allowUserTheme = allowUserTheme();
|
feat: extend module platform with UI slots, runtime components, CLI tooling and {{userId}} search support
Completes the generic module platform that enables modules to contribute
UI elements, runtime JS components, and search resources without any
core hardcoding.
New generic UI slot types:
- topbar.right_item: module-contributed topbar buttons
- layout.body_end_template: module-contributed dialog/overlay templates
- layout.head_style: module-contributed global CSS
- runtime.component: declarative JS component registration with phase ordering
New infrastructure:
- ModuleAutoloader: PSR-4 autoloading for module-local PHP classes
- ModuleRuntimePageBuilder: symlinks module pages into runtime directory
- ModuleRuntimeAssetPublisher: publishes module CSS/JS to web/modules/
- ModulePermissionSynchronizer: syncs module permissions to DB
- CLI scripts: module-runtime-sync, module-build, module-migrate,
module-permissions-sync, module-assets-sync
- {{userId}} placeholder in SearchDataService for user-scoped search queries
- Component runtime with phased initialization (early/default/late)
- AppContainer.protectExistingBindings() to prevent module→core overwrites
- Architecture tests: ModuleStructureContractTest, CoreTemplateIsolationTest,
FrontendComponentRuntimeContractTest, AppContainerIsolationContractTest
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 22:19:56 +01:00
|
|
|
$layoutAuth = is_array($viewAuth['layout'] ?? null) ? $viewAuth['layout'] : [];
|
|
|
|
|
$layoutNav = is_array($layoutNav ?? null) ? $layoutNav : [];
|
|
|
|
|
$moduleSlots = is_array($layoutNav['moduleSlots'] ?? null) ? $layoutNav['moduleSlots'] : [];
|
|
|
|
|
$moduleTopbarSlots = is_array($moduleSlots['topbar.right_item'] ?? null) ? $moduleSlots['topbar.right_item'] : [];
|
2026-03-14 21:45:58 +01:00
|
|
|
|
2026-02-04 23:31:53 +01:00
|
|
|
?>
|
2026-04-05 17:17:06 +02:00
|
|
|
<header class="app-header">
|
2026-03-05 12:51:53 +01:00
|
|
|
<nav class="app-topbar">
|
2026-04-05 17:17:06 +02:00
|
|
|
<div class="app-topbar-left">
|
2026-04-06 22:21:39 +02:00
|
|
|
<button type="button" class="app-topbar-hamburger" data-sidebar-toggle
|
|
|
|
|
aria-expanded="false"
|
|
|
|
|
aria-label="<?php e(t('Open navigation')); ?>"
|
|
|
|
|
data-open-label="<?php e(t('Open navigation')); ?>"
|
|
|
|
|
data-close-label="<?php e(t('Close navigation')); ?>">
|
|
|
|
|
<i class="bi bi-list" aria-hidden="true"></i>
|
|
|
|
|
</button>
|
|
|
|
|
<a href="<?php e(lurl('')); ?>" class="app-topbar-brand">
|
|
|
|
|
<?php if ($brandHasTenantAvatar): ?>
|
|
|
|
|
<img src="auth/tenant-avatar-file?uuid=<?php e($brandTenantUuid); ?>&size=256" alt="<?php e($brandTenantName); ?>">
|
|
|
|
|
<?php elseif ($brandTenantName !== ''): ?>
|
|
|
|
|
<span class="app-topbar-brand-name"><?php e($brandTenantName); ?></span>
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
<span class="app-topbar-brand-name"><?php e(appTitle()); ?></span>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
</a>
|
2026-04-05 17:17:06 +02:00
|
|
|
<?php
|
|
|
|
|
if (is_array($breadcrumbs ?? null) && $breadcrumbs !== []) {
|
|
|
|
|
require __DIR__ . '/app-breadcrumb.phtml';
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
<span id="async-messages" role="status" aria-live="polite" aria-hidden="true"></span>
|
|
|
|
|
</div>
|
2026-04-01 16:31:59 +02:00
|
|
|
<div class="app-topbar-center">
|
|
|
|
|
<button type="button" class="app-topbar-search-trigger" data-app-search-trigger aria-label="<?php e(t('Search')); ?>" title="<?php e(t('Search')); ?>">
|
|
|
|
|
<i class="bi bi-search" aria-hidden="true"></i>
|
|
|
|
|
<span class="app-topbar-search-trigger-text"><?php e(t('Search...')); ?></span>
|
|
|
|
|
<kbd class="app-topbar-search-trigger-shortcut" data-search-trigger-shortcut aria-hidden="true"></kbd>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
2026-03-05 12:51:53 +01:00
|
|
|
<ul class="app-topbar-right">
|
2026-04-06 22:21:39 +02:00
|
|
|
<?php foreach ($moduleTopbarSlots as $slot): ?>
|
|
|
|
|
<?php
|
|
|
|
|
if (!is_array($slot)) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
$slotPermission = trim((string) ($slot['permission'] ?? ''));
|
|
|
|
|
if ($slotPermission !== '' && empty($layoutAuth[$slotPermission])) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
$slotTemplate = trim((string) ($slot['template'] ?? ''));
|
|
|
|
|
if ($slotTemplate === '' || !is_file($slotTemplate)) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
include $slotTemplate;
|
|
|
|
|
?>
|
|
|
|
|
<?php endforeach; ?>
|
2026-03-11 23:33:17 +01:00
|
|
|
<?php if ($canSwitchTenant): ?>
|
2026-04-06 22:21:39 +02:00
|
|
|
<li data-app-component="tenant-switcher" data-tenant-switcher data-tooltip="<?php e(t('Tenant')); ?>" data-tooltip-pos="bottom">
|
|
|
|
|
<details class="dropdown app-topbar-tenant-menu" data-summary-chevron="none">
|
|
|
|
|
<summary aria-label="<?php e(t('Switch tenant')); ?>" title="<?php e($tenantLabel); ?>">
|
|
|
|
|
<i class="bi bi-building" aria-hidden="true"></i>
|
2026-02-11 19:28:12 +01:00
|
|
|
</summary>
|
2026-03-05 12:51:53 +01:00
|
|
|
<ul class="app-topbar-menu-list app-topbar-menu-list--right">
|
2026-02-04 23:31:53 +01:00
|
|
|
<?php foreach ($availableTenants as $tenant): ?>
|
2026-03-05 12:51:53 +01:00
|
|
|
<?php
|
|
|
|
|
$tenantId = (int) ($tenant['id'] ?? 0);
|
|
|
|
|
$isActive = $tenantId === $currentTenantId;
|
|
|
|
|
$rowLabel = trim((string) ($tenant['description'] ?? ''));
|
|
|
|
|
if ($rowLabel === '') {
|
|
|
|
|
$rowLabel = t('None');
|
|
|
|
|
}
|
|
|
|
|
?>
|
2026-02-04 23:31:53 +01:00
|
|
|
<li>
|
|
|
|
|
<a href="#"
|
2026-03-05 12:51:53 +01:00
|
|
|
class="<?php e($isActive ? 'active' : ''); ?>"
|
|
|
|
|
title="<?php e($rowLabel); ?>"
|
|
|
|
|
<?php if ($isActive): ?>
|
|
|
|
|
aria-current="true"
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
data-switch-tenant="<?php e((string) $tenantId); ?>"
|
|
|
|
|
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($rowLabel); ?>
|
2026-02-04 23:31:53 +01:00
|
|
|
<?php if ($isActive): ?>
|
|
|
|
|
<i class="bi bi-check"></i>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
</ul>
|
|
|
|
|
</details>
|
2026-03-11 23:33:17 +01:00
|
|
|
</li>
|
|
|
|
|
<?php endif; ?>
|
2026-03-14 21:45:58 +01:00
|
|
|
<li>
|
2026-04-06 22:21:39 +02:00
|
|
|
<details class="dropdown app-topbar-user-menu" data-summary-chevron="none" data-app-component="theme-controls"
|
2026-03-05 12:51:53 +01:00
|
|
|
<?php if ($allowUserTheme): ?>
|
|
|
|
|
data-theme-menu
|
|
|
|
|
data-theme-url="admin/users/theme"
|
|
|
|
|
data-csrf-key="<?php e($csrfKey); ?>"
|
|
|
|
|
data-csrf-token="<?php e($csrfToken); ?>"
|
|
|
|
|
<?php endif; ?>>
|
|
|
|
|
<summary aria-label="<?php e(t('Account')); ?>">
|
2026-04-06 22:21:39 +02:00
|
|
|
<i class="bi bi-person"></i>
|
2026-03-05 12:51:53 +01:00
|
|
|
</summary>
|
|
|
|
|
<ul class="app-topbar-menu-list app-topbar-menu-list--right">
|
|
|
|
|
<li class="app-topbar-menu-heading" role="presentation"><small><?php e(t('Navigation')); ?></small></li>
|
|
|
|
|
<li>
|
|
|
|
|
<button type="button" class="app-topbar-menu-with-hotkey" id="toggle-aside" data-sidebar-toggle data-sidebar-action="visibility" aria-label="<?php e(t('Toggle Sidebar')); ?>">
|
|
|
|
|
<span><?php e(t('Toggle Sidebar')); ?></span>
|
|
|
|
|
<span class="app-topbar-hotkey" aria-hidden="true">Ctrl/Cmd+B</span>
|
|
|
|
|
</button>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="app-topbar-menu-item-detail-sidebar">
|
feat: extend module platform with UI slots, runtime components, CLI tooling and {{userId}} search support
Completes the generic module platform that enables modules to contribute
UI elements, runtime JS components, and search resources without any
core hardcoding.
New generic UI slot types:
- topbar.right_item: module-contributed topbar buttons
- layout.body_end_template: module-contributed dialog/overlay templates
- layout.head_style: module-contributed global CSS
- runtime.component: declarative JS component registration with phase ordering
New infrastructure:
- ModuleAutoloader: PSR-4 autoloading for module-local PHP classes
- ModuleRuntimePageBuilder: symlinks module pages into runtime directory
- ModuleRuntimeAssetPublisher: publishes module CSS/JS to web/modules/
- ModulePermissionSynchronizer: syncs module permissions to DB
- CLI scripts: module-runtime-sync, module-build, module-migrate,
module-permissions-sync, module-assets-sync
- {{userId}} placeholder in SearchDataService for user-scoped search queries
- Component runtime with phased initialization (early/default/late)
- AppContainer.protectExistingBindings() to prevent module→core overwrites
- Architecture tests: ModuleStructureContractTest, CoreTemplateIsolationTest,
FrontendComponentRuntimeContractTest, AppContainerIsolationContractTest
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 22:19:56 +01:00
|
|
|
<button type="button" id="toggle-main-content-aside" data-app-component="details-aside-toggle" aria-label="<?php e(t('Toggle Detail Sidebar')); ?>">
|
2026-03-05 12:51:53 +01:00
|
|
|
<?php e(t('Toggle Detail Sidebar')); ?>
|
|
|
|
|
</button>
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
<li class="app-topbar-menu-divider" role="separator"></li>
|
|
|
|
|
<li class="app-topbar-menu-heading" role="presentation"><small><?php e(t('Display')); ?></small></li>
|
|
|
|
|
<?php if ($allowUserTheme): ?>
|
|
|
|
|
<?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' : ''); ?>"
|
2026-04-06 12:08:25 +02:00
|
|
|
<?php echo $isActiveTheme ? 'aria-current="true"' : ''; // raw-html-ok: hardcoded ARIA attribute ?>>
|
2026-03-05 12:51:53 +01:00
|
|
|
<?php e(t($label)); ?>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
<li>
|
feat: extend module platform with UI slots, runtime components, CLI tooling and {{userId}} search support
Completes the generic module platform that enables modules to contribute
UI elements, runtime JS components, and search resources without any
core hardcoding.
New generic UI slot types:
- topbar.right_item: module-contributed topbar buttons
- layout.body_end_template: module-contributed dialog/overlay templates
- layout.head_style: module-contributed global CSS
- runtime.component: declarative JS component registration with phase ordering
New infrastructure:
- ModuleAutoloader: PSR-4 autoloading for module-local PHP classes
- ModuleRuntimePageBuilder: symlinks module pages into runtime directory
- ModuleRuntimeAssetPublisher: publishes module CSS/JS to web/modules/
- ModulePermissionSynchronizer: syncs module permissions to DB
- CLI scripts: module-runtime-sync, module-build, module-migrate,
module-permissions-sync, module-assets-sync
- {{userId}} placeholder in SearchDataService for user-scoped search queries
- Component runtime with phased initialization (early/default/late)
- AppContainer.protectExistingBindings() to prevent module→core overwrites
- Architecture tests: ModuleStructureContractTest, CoreTemplateIsolationTest,
FrontendComponentRuntimeContractTest, AppContainerIsolationContractTest
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 22:19:56 +01:00
|
|
|
<button type="button" data-app-component="contrast-toggle" data-contrast-toggle aria-label="<?php e(t('Toggle contrast')); ?>" aria-pressed="false">
|
2026-03-05 12:51:53 +01:00
|
|
|
<?php e(t('High contrast')); ?>
|
|
|
|
|
</button>
|
|
|
|
|
</li>
|
|
|
|
|
<li class="app-topbar-menu-divider" role="separator"></li>
|
|
|
|
|
<li class="app-topbar-menu-heading" role="presentation"><small><?php e(t('Language')); ?></small></li>
|
|
|
|
|
<?php
|
|
|
|
|
$variant = 'menu-items';
|
|
|
|
|
require __DIR__ . '/app-language-switcher.phtml';
|
|
|
|
|
unset($variant);
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
<li class="app-topbar-menu-divider" role="separator"></li>
|
|
|
|
|
<li class="app-topbar-menu-heading" role="presentation"><small><?php e(t('Account')); ?></small></li>
|
2026-02-11 19:28:12 +01:00
|
|
|
<li><a href="<?php e($accountEditUrl); ?>">
|
2026-03-05 12:51:53 +01:00
|
|
|
<?php e(t('My account')); ?>
|
2026-02-04 23:31:53 +01:00
|
|
|
</a>
|
|
|
|
|
</li>
|
2026-02-11 19:28:12 +01:00
|
|
|
<li><a href="<?php e(lurl('help/hotkeys')); ?>">
|
|
|
|
|
<?php e(t('Keyboard shortcuts')); ?>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
2026-03-05 12:51:53 +01:00
|
|
|
|
|
|
|
|
<li class="app-topbar-menu-divider" role="separator"></li>
|
|
|
|
|
<li class="app-topbar-menu-heading" role="presentation"><small><?php e(t('Session')); ?></small></li>
|
2026-02-04 23:31:53 +01:00
|
|
|
<li><a href="logout">
|
|
|
|
|
<?php e(t('Logout')); ?>
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</details>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</nav>
|
|
|
|
|
</header>
|