refactor(addressbook): move from aside icon-bar to explorer nav link

Introduce generic explorer.nav_item slot type in app-main-aside.phtml
so modules can contribute links to the explorer nav panel.

Switch addressbook module from aside.tab_panel to explorer.nav_item.
Remove aside department-filter panel, AddressBookLayoutProvider, and
AddressBookSessionProvider (only served the now-removed aside panel).

Fix grid Name column overflow into Email column: CSS selector
.grid-name-cell > span:last-child never matched the <a> name link;
changed to :last-child and scoped flex-shrink:0 to :first-child only.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-26 15:06:15 +01:00
parent 376cf67c31
commit 5b2ea6bf27
9 changed files with 35 additions and 408 deletions

View File

@@ -6,6 +6,9 @@ $layoutAuth = is_array($viewAuth['layout'] ?? null) ? $viewAuth['layout'] : [];
$moduleNavItemSlots = is_array(($layoutNav ?? [])['moduleSlots']['sidebar.admin_nav_item'] ?? null)
? $layoutNav['moduleSlots']['sidebar.admin_nav_item']
: [];
$moduleExplorerNavSlots = is_array(($layoutNav ?? [])['moduleSlots']['explorer.nav_item'] ?? null)
? $layoutNav['moduleSlots']['explorer.nav_item']
: [];
$canViewTenants = (bool) ($layoutAuth['can_view_tenants'] ?? false);
$canViewDepartments = (bool) ($layoutAuth['can_view_departments'] ?? false);
$canViewUsers = (bool) ($layoutAuth['can_view_users'] ?? false);
@@ -308,6 +311,26 @@ $moduleSearchSlots = is_array($moduleSlots['search.resource_item'] ?? null) ? $m
<?php e(t('Home')); ?>
</a>
</li>
<?php foreach ($moduleExplorerNavSlots as $explorerSlot):
if (!is_array($explorerSlot)) { continue; }
$explorerKey = $explorerSlot['key'] ?? '';
$explorerLabel = $explorerSlot['label'] ?? '';
$explorerHref = $explorerSlot['href'] ?? '';
$explorerPermission = $explorerSlot['permission'] ?? '';
if ($explorerKey === '' || $explorerHref === '') { continue; }
if ($explorerPermission !== '' && empty($layoutAuth[$explorerPermission])) { continue; }
if (!str_starts_with($explorerHref, '/') && !str_starts_with($explorerHref, 'http')) {
$explorerHref = lurl($explorerHref);
}
$explorerActive = navActive($explorerSlot['href'], true);
?>
<li>
<a href="<?php e($explorerHref); ?>" class="<?php e($explorerActive['class'] ?? ''); ?>"
<?php echo $explorerActive['aria'] ?? ''; ?>>
<?php e(t($explorerLabel)); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</nav>
<?php if ($hasAdminPanel): ?>