Files
breadcrumb-the-shire/modules/help-center/templates/aside-help-panel.phtml
fs 87652e55da refactor(system-info): reduce to Stripe-style status page
Reduce admin/system-info to a single focused status view: overall
status banner, components list from existing health checks, and an
environment meta table. Drops the Modules and Permissions tabs —
those were dev-diagnostics already available via CLI.

- Remove SystemInfoService + its test; wire the action directly to
  SystemHealthService and build meta inline
- Extend SystemHealthService with per-check label + description so
  the UI speaks in customer terms while the CLI doctor path stays
  compatible
- Rebuild the view on existing app-stats-table + app-empty-state
  primitives; add a small app-status-banner component for the
  headline signal
- Align help-center nav label and i18n keys (de/en)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 16:32:46 +02:00

80 lines
3.0 KiB
PHTML

<?php
use MintyPHP\Service\Docs\DocsCatalogService;
$layoutAuth = is_array($viewAuth['layout'] ?? null) ? $viewAuth['layout'] : [];
$layoutNav = is_array($layoutNav ?? null) ? $layoutNav : [];
$helpNav = is_array($layoutNav['help-center.nav'] ?? null) ? $layoutNav['help-center.nav'] : [];
$canViewDocs = !empty($layoutAuth['can_view_docs']);
$canViewApiDocs = !empty($helpNav['can_view_api_docs']);
$canViewSystemInfo = !empty($layoutAuth['can_view_system_info']);
$docsDefaultSlug = $canViewDocs ? DocsCatalogService::defaultSlug() : '';
$helpNavGroups = [
[
'key' => 'help-documentation',
'label' => t('Documentation'),
'icon' => 'bi-book',
'items' => [
[
'label' => t('Documentation'),
'path' => $docsDefaultSlug !== '' ? 'admin/docs/' . $docsDefaultSlug : '',
'active' => navActive('admin/docs', true),
'visible' => $canViewDocs && $docsDefaultSlug !== '',
],
[
'label' => t('API docs'),
'path' => 'admin/api-docs',
'active' => navActive('admin/api-docs', true),
'visible' => $canViewApiDocs,
],
],
],
[
'key' => 'help-system',
'label' => t('System'),
'icon' => 'bi-info-circle',
'items' => [
[
'label' => t('System status'),
'path' => 'admin/system-info',
'active' => navActive('admin/system-info', true),
'visible' => $canViewSystemInfo,
],
],
],
];
?>
<ul class="app-sidebar-admin-nav" aria-label="<?php e(t('Help')); ?>">
<?php foreach ($helpNavGroups as $group):
$items = array_values(array_filter($group['items'], static fn ($item) => !empty($item['visible'])));
if (!$items) { continue; }
$groupIsActive = false;
foreach ($items as $item) {
$activeState = $item['active'] ?? [];
if (!empty($activeState['isActive'])) { $groupIsActive = true; break; }
}
?>
<li class="app-sidebar-group app-sidebar-admin-group">
<details data-details-key="<?php e($group['key']); ?>"<?php if ($groupIsActive): ?> open<?php endif; ?>>
<summary>
<i class="bi <?php e($group['icon']); ?>"></i>
<span><?php e($group['label']); ?></span>
</summary>
<ul>
<?php foreach ($items as $item):
$active = $item['active'] ?? ['class' => '', 'aria' => ''];
?>
<li>
<a href="<?php e(lurl($item['path'])); ?>" class="<?php e($active['class'] ?? ''); ?>" <?php echo $active['aria'] ?? ''; // raw-html-ok: pre-built ARIA attribute from navActive() ?>>
<?php e($item['label']); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</details>
</li>
<?php endforeach; ?>
</ul>