1
0
Files
breadcrumb-the-shire/pages/admin/permissions/edit(default).phtml
fs b749b5d192 feat: centralize breadcrumbs in topbar and remove history navigation
Move breadcrumb rendering from individual page templates into the core
topbar. Each page now sets $breadcrumbs in its action .php file; the
topbar renders it automatically via the shared partial.

- Remove global back/forward buttons and app-nav-history.js component
- Remove Alt+Arrow keyboard shortcuts for history navigation
- Render breadcrumb in topbar-left section (replaces button area)
- Clean up breadcrumb CSS: context-neutral base (flex, no margin)
- Recalculate sticky titlebar offset in details container
- Migrate all 41 pages (core + helpdesk, audit, addressbook, api-docs)
- Add missing breadcrumbs to addressbook detail view
- Update architecture contract tests (nav-history references removed)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 17:17:06 +02:00

93 lines
2.9 KiB
PHTML

<?php
/**
* @var array<int, string> $errors
* @var array $form
* @var array $permission
* @var bool $canUpdatePermission
* @var bool $canDeletePermission
*/
use MintyPHP\Session;
$canUpdatePermission = (bool) ($canUpdatePermission ?? false);
$canDeletePermission = (bool) ($canDeletePermission ?? false);
$isReadOnly = !$canUpdatePermission;
$titleText = $titleText ?? ($isReadOnly ? t('View permission') : t('Edit permission'));
?>
<div class="app-details-container">
<section>
<?php
$titlebar = [
'title' => $titleText,
'backHref' => 'admin/permissions',
'backTitle' => t('Cancel'),
'actions' => $canUpdatePermission ? [
[
'form' => 'permission-form',
'name' => 'action',
'value' => 'save',
'class' => 'secondary outline',
'label' => t('Save'),
],
[
'form' => 'permission-form',
'name' => 'action',
'value' => 'save_close',
'class' => 'primary',
'label' => t('Save & close'),
],
] : [],
];
require templatePath('partials/app-details-titlebar.phtml');
?>
<?php
$validationSummaryErrors = $validationSummaryErrors ?? ($errors ?? []);
require templatePath('partials/app-details-validation-summary.phtml');
?>
<?php
$values = $form ?? $permission ?? [];
$isReadOnly = !$canUpdatePermission;
$detailsOpenAll = true;
$isReadOnly = $isReadOnly ?? false;
$showDangerZone = $canDeletePermission;
$dangerZoneDeleteFormId = $showDangerZone ? 'permission-delete-form' : '';
$dangerZoneWarning = t('This will permanently delete this permission.');
$dangerZoneActionLabel = t('Delete permission');
require __DIR__ . '/_form.phtml';
?>
<?php if ($showDangerZone): ?>
<form
id="permission-delete-form"
method="post"
action="admin/permissions/delete/<?php e((string) ($permission['id'] ?? '')); ?>"
hidden
data-detail-confirm-message="<?php e(t('Delete this permission?')); ?>"
data-detail-action-kind="delete"
>
<?php Session::getCsrfInput(); ?>
</form>
<?php endif; ?>
</section>
<aside id="app-details-aside-section">
<div class="app-details-aside-section">
<hgroup>
<h2><?php e($values['key'] ?? ''); ?></h2>
<p><?php e(t('Permission')); ?></p>
</hgroup>
<div class="badge-list">
<?php if ((string) ($values['active'] ?? '1') === '0'): ?>
<span class="badge" data-variant="danger"><?php e(t('Inactive')); ?></span>
<?php else: ?>
<span class="badge" data-variant="success"><?php e(t('Active')); ?></span>
<?php endif; ?>
<?php if (!empty($values['is_system'])): ?>
<span class="badge" data-variant="neutral"><?php e(t('System')); ?></span>
<?php endif; ?>
</div>
<hr>
</div>
</aside>
</div>