1
0
Files
breadcrumb-the-shire/modules/helpdesk/templates/aside-helpdesk-panel.phtml
fs a0d7670dd7 feat(helpdesk): align module with core list/drawer standards
- add helpdesk module pages, services, settings and tests

- standardize debtor list on drawer/grid contracts and robust filter drawer behavior

- add helpdesk aside panel navigation and settings visibility provider

- switch primary list slug to helpdesk/debitor and remove helpdesk/search compatibility

- include required core contract updates for list contracts and detail/drawer integration
2026-04-02 17:48:27 +02:00

55 lines
2.0 KiB
PHTML

<?php
$layoutNav = is_array($layoutNav ?? null) ? $layoutNav : [];
$helpdeskNav = is_array($layoutNav['helpdesk.nav'] ?? null) ? $layoutNav['helpdesk.nav'] : [];
$canManageSettings = !empty($helpdeskNav['can_manage_settings']);
$helpdeskNavItems = [
[
'label' => t('Customers'),
'path' => 'helpdesk/debitor',
'active' => navActive('helpdesk/debitor', true),
'visible' => true,
],
[
'label' => t('Settings'),
'path' => 'helpdesk/settings',
'active' => navActive('helpdesk/settings', true),
'visible' => $canManageSettings,
],
];
$visibleItems = array_values(array_filter($helpdeskNavItems, static fn (array $item): bool => !empty($item['visible'])));
$groupIsActive = false;
foreach ($visibleItems as $item) {
$activeState = $item['active'] ?? [];
if (!empty($activeState['isActive'])) {
$groupIsActive = true;
break;
}
}
?>
<ul class="app-sidebar-admin-nav" aria-label="<?php e(t('Helpdesk')); ?>">
<?php if ($visibleItems): ?>
<li class="app-sidebar-group app-sidebar-admin-group">
<details data-details-key="helpdesk-navigation"<?php if ($groupIsActive): ?> open<?php endif; ?>>
<summary>
<i class="bi bi-headset"></i>
<span><?php e(t('Helpdesk')); ?></span>
</summary>
<ul>
<?php foreach ($visibleItems as $item):
$active = $item['active'] ?? ['class' => '', 'aria' => ''];
?>
<li>
<a href="<?php e(lurl($item['path'])); ?>" class="<?php e($active['class'] ?? ''); ?>" <?php echo $active['aria'] ?? ''; ?>>
<?php e($item['label']); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</details>
</li>
<?php endif; ?>
</ul>