2026-02-04 23:31:53 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @var array $values
|
|
|
|
|
* @var string|null $formId
|
|
|
|
|
* @var bool $detailsOpenAll
|
|
|
|
|
* @var bool $isReadOnly
|
add composer-unused, comprehensive docs, and project restructure
- Add icanhazstring/composer-unused as dev dependency for dependency hygiene checks
- Add German documentation (docs/) covering architecture, conventions, workflows, and developer checklists
- Add API layer (ApiAuth, ApiBootstrap, ApiResponse), audit, scheduler, custom fields, and SSO services
- Add Microsoft OIDC SSO, API token management, and user lifecycle features
- Add swagger-ui vendor integration and OpenAPI spec
- Add production Docker setup and bin/ scripts
- Update composer dependencies, config, templates, and frontend assets throughout
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 15:27:35 +01:00
|
|
|
* @var bool $showDangerZone
|
|
|
|
|
* @var string|null $dangerZoneDeleteFormId
|
|
|
|
|
* @var string|null $dangerZoneWarning
|
|
|
|
|
* @var string|null $dangerZoneActionLabel
|
2026-02-04 23:31:53 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
use MintyPHP\Session;
|
|
|
|
|
|
|
|
|
|
$values = $values ?? [];
|
|
|
|
|
$formId = $formId ?? 'role-form';
|
|
|
|
|
$detailsOpenAll = $detailsOpenAll ?? false;
|
|
|
|
|
$isReadOnly = $isReadOnly ?? false;
|
add composer-unused, comprehensive docs, and project restructure
- Add icanhazstring/composer-unused as dev dependency for dependency hygiene checks
- Add German documentation (docs/) covering architecture, conventions, workflows, and developer checklists
- Add API layer (ApiAuth, ApiBootstrap, ApiResponse), audit, scheduler, custom fields, and SSO services
- Add Microsoft OIDC SSO, API token management, and user lifecycle features
- Add swagger-ui vendor integration and OpenAPI spec
- Add production Docker setup and bin/ scripts
- Update composer dependencies, config, templates, and frontend assets throughout
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 15:27:35 +01:00
|
|
|
$showDangerZone = (bool) ($showDangerZone ?? false);
|
|
|
|
|
$dangerZoneDeleteFormId = (string) ($dangerZoneDeleteFormId ?? '');
|
|
|
|
|
$dangerZoneWarning = (string) ($dangerZoneWarning ?? t('This action cannot be undone.'));
|
|
|
|
|
$dangerZoneActionLabel = (string) ($dangerZoneActionLabel ?? t('Delete'));
|
2026-02-04 23:31:53 +01:00
|
|
|
$detailsOpenAttr = $detailsOpenAll ? 'open' : '';
|
|
|
|
|
$readonlyAttr = $isReadOnly ? 'readonly' : '';
|
2026-02-11 19:28:12 +01:00
|
|
|
$disabledAttr = $isReadOnly ? 'disabled' : '';
|
2026-03-13 09:49:11 +01:00
|
|
|
$permissions = is_array($permissions ?? null) ? $permissions : [];
|
|
|
|
|
$selectedPermissionIds = is_array($selectedPermissionIds ?? null) ? $selectedPermissionIds : [];
|
2026-03-13 21:11:48 +01:00
|
|
|
$allRolesForAssignable = is_array($allRolesForAssignable ?? null) ? $allRolesForAssignable : [];
|
|
|
|
|
$selectedAssignableRoleIds = is_array($selectedAssignableRoleIds ?? null) ? $selectedAssignableRoleIds : [];
|
2026-02-04 23:31:53 +01:00
|
|
|
|
|
|
|
|
?>
|
2026-03-04 15:56:58 +01:00
|
|
|
<form id="<?php e($formId); ?>" method="post" data-standard-detail-form="1">
|
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
|
|
|
<div class="app-tabs" data-tabs data-app-component="tabs" data-tabs-param="tab" data-tabs-storage-key="admin-role-form"<?php if (!empty($ignoreTabStorage)) { echo ' data-tabs-ignore-storage'; } ?>>
|
add composer-unused, comprehensive docs, and project restructure
- Add icanhazstring/composer-unused as dev dependency for dependency hygiene checks
- Add German documentation (docs/) covering architecture, conventions, workflows, and developer checklists
- Add API layer (ApiAuth, ApiBootstrap, ApiResponse), audit, scheduler, custom fields, and SSO services
- Add Microsoft OIDC SSO, API token management, and user lifecycle features
- Add swagger-ui vendor integration and OpenAPI spec
- Add production Docker setup and bin/ scripts
- Update composer dependencies, config, templates, and frontend assets throughout
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 15:27:35 +01:00
|
|
|
<div class="app-tabs-nav">
|
|
|
|
|
<button type="button" data-tab="basic" data-tab-default><?php e(t('Master data')); ?></button>
|
2026-03-13 09:49:11 +01:00
|
|
|
<button type="button" data-tab="permissions"><?php e(t('Permissions')); ?></button>
|
2026-03-13 21:11:48 +01:00
|
|
|
<button type="button" data-tab="assignable-roles"><?php e(t('Assignable roles')); ?></button>
|
add composer-unused, comprehensive docs, and project restructure
- Add icanhazstring/composer-unused as dev dependency for dependency hygiene checks
- Add German documentation (docs/) covering architecture, conventions, workflows, and developer checklists
- Add API layer (ApiAuth, ApiBootstrap, ApiResponse), audit, scheduler, custom fields, and SSO services
- Add Microsoft OIDC SSO, API token management, and user lifecycle features
- Add swagger-ui vendor integration and OpenAPI spec
- Add production Docker setup and bin/ scripts
- Update composer dependencies, config, templates, and frontend assets throughout
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 15:27:35 +01:00
|
|
|
<button type="button" data-tab="visibility"><?php e(t('Visibility')); ?></button>
|
|
|
|
|
<?php if ($showDangerZone && $dangerZoneDeleteFormId !== ''): ?>
|
|
|
|
|
<button type="button" data-tab="danger"><?php e(t('Danger zone')); ?></button>
|
|
|
|
|
<?php endif; ?>
|
2026-02-11 19:28:12 +01:00
|
|
|
</div>
|
add composer-unused, comprehensive docs, and project restructure
- Add icanhazstring/composer-unused as dev dependency for dependency hygiene checks
- Add German documentation (docs/) covering architecture, conventions, workflows, and developer checklists
- Add API layer (ApiAuth, ApiBootstrap, ApiResponse), audit, scheduler, custom fields, and SSO services
- Add Microsoft OIDC SSO, API token management, and user lifecycle features
- Add swagger-ui vendor integration and OpenAPI spec
- Add production Docker setup and bin/ scripts
- Update composer dependencies, config, templates, and frontend assets throughout
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 15:27:35 +01:00
|
|
|
|
|
|
|
|
<div data-tab-panel="basic">
|
|
|
|
|
<div class="grid">
|
|
|
|
|
<label for="description">
|
|
|
|
|
<span><?php e(t('Description')); ?></span>
|
|
|
|
|
<input required type="text" name="description" id="description" value="<?php e($values['description'] ?? ''); ?>" <?php e($readonlyAttr); ?> />
|
|
|
|
|
</label>
|
|
|
|
|
<div class="grid">
|
|
|
|
|
<label for="code">
|
|
|
|
|
<span><?php e(t('Code')); ?></span>
|
|
|
|
|
<input type="text" name="code" id="code" value="<?php e($values['code'] ?? ''); ?>" <?php e($readonlyAttr); ?> />
|
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-03-13 09:49:11 +01:00
|
|
|
<div data-tab-panel="permissions">
|
|
|
|
|
<?php if ($permissions): ?>
|
feat(ui): token-select primitive for large multi-selects
Adds tokenSelectForm() in core/Support/helpers/ui.php: an inline
typeahead combobox + flat alphabetical removable list, designed for
selections that outgrow the chip-header of the vendor MultiSelect
(roles, permissions, and similar admin pickers).
Contract:
- Hidden <select multiple name="<name>[]"> is the form submission source —
consumers read via $request->body() verbatim, no parsing
- Items are ['id' => int, <labelKey> => string, 'key' => string?]
where labelKeys default to ['description', 'label', 'name']; 'key' is
an invisible fuzzy-match hint
- $labelOverrides lets callers swap emptyState / removeTooltip /
noMatches / clearAll / countSuffix / errorMessage with domain copy
- $disabled renders pure-presentation list (no combobox, no remove)
Runtime:
- initTokenSelect in web/js/components/app-token-select.js is registered
as 'token-select' in app-init.js; destroy()/cleanupFns contract
- Syncs the hidden <select> on every mutation and dispatches 'change'
so dependent UI can react
Wired up: pages/admin/permissions/_form.phtml (assigned roles),
pages/admin/roles/_form.phtml (permissions + assignable roles).
Helper contract lives in tests/Support/Helpers/TokenSelectFormHelperTest.php;
runtime contract + entrypoint registration + host usage are enforced by
FrontendRuntime*ContractTest.php.
Coexists with multiSelectForm() — pick tokenSelectForm() when the
selected set can grow beyond ~10 items or typeahead is expected.
Docs in CLAUDE.md.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:52:32 +02:00
|
|
|
<?php tokenSelectForm(
|
|
|
|
|
'role-permissions',
|
|
|
|
|
'permission_ids',
|
|
|
|
|
'Assigned permissions',
|
|
|
|
|
'Search permissions…',
|
|
|
|
|
$permissions,
|
|
|
|
|
$selectedPermissionIds,
|
|
|
|
|
$isReadOnly,
|
|
|
|
|
['description', 'key'],
|
|
|
|
|
null,
|
|
|
|
|
[
|
|
|
|
|
'emptyState' => t('No permissions selected'),
|
|
|
|
|
'removeTooltip' => t('Remove permission'),
|
|
|
|
|
]
|
|
|
|
|
); ?>
|
2026-03-13 09:49:11 +01:00
|
|
|
<?php else: ?>
|
|
|
|
|
<?php
|
|
|
|
|
$emptyState = [
|
|
|
|
|
'message' => t('No permissions available'),
|
|
|
|
|
'hint' => t('No active permissions are configured yet.'),
|
|
|
|
|
'size' => 'compact',
|
|
|
|
|
];
|
|
|
|
|
require templatePath('partials/app-empty-state.phtml');
|
|
|
|
|
?>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
</div>
|
add composer-unused, comprehensive docs, and project restructure
- Add icanhazstring/composer-unused as dev dependency for dependency hygiene checks
- Add German documentation (docs/) covering architecture, conventions, workflows, and developer checklists
- Add API layer (ApiAuth, ApiBootstrap, ApiResponse), audit, scheduler, custom fields, and SSO services
- Add Microsoft OIDC SSO, API token management, and user lifecycle features
- Add swagger-ui vendor integration and OpenAPI spec
- Add production Docker setup and bin/ scripts
- Update composer dependencies, config, templates, and frontend assets throughout
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 15:27:35 +01:00
|
|
|
|
2026-03-13 21:11:48 +01:00
|
|
|
<div data-tab-panel="assignable-roles">
|
|
|
|
|
<?php if ($allRolesForAssignable): ?>
|
feat(ui): token-select primitive for large multi-selects
Adds tokenSelectForm() in core/Support/helpers/ui.php: an inline
typeahead combobox + flat alphabetical removable list, designed for
selections that outgrow the chip-header of the vendor MultiSelect
(roles, permissions, and similar admin pickers).
Contract:
- Hidden <select multiple name="<name>[]"> is the form submission source —
consumers read via $request->body() verbatim, no parsing
- Items are ['id' => int, <labelKey> => string, 'key' => string?]
where labelKeys default to ['description', 'label', 'name']; 'key' is
an invisible fuzzy-match hint
- $labelOverrides lets callers swap emptyState / removeTooltip /
noMatches / clearAll / countSuffix / errorMessage with domain copy
- $disabled renders pure-presentation list (no combobox, no remove)
Runtime:
- initTokenSelect in web/js/components/app-token-select.js is registered
as 'token-select' in app-init.js; destroy()/cleanupFns contract
- Syncs the hidden <select> on every mutation and dispatches 'change'
so dependent UI can react
Wired up: pages/admin/permissions/_form.phtml (assigned roles),
pages/admin/roles/_form.phtml (permissions + assignable roles).
Helper contract lives in tests/Support/Helpers/TokenSelectFormHelperTest.php;
runtime contract + entrypoint registration + host usage are enforced by
FrontendRuntime*ContractTest.php.
Coexists with multiSelectForm() — pick tokenSelectForm() when the
selected set can grow beyond ~10 items or typeahead is expected.
Docs in CLAUDE.md.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:52:32 +02:00
|
|
|
<?php tokenSelectForm(
|
|
|
|
|
'role-assignable-roles',
|
|
|
|
|
'assignable_role_ids',
|
|
|
|
|
'Assignable roles',
|
|
|
|
|
'Search roles…',
|
|
|
|
|
$allRolesForAssignable,
|
|
|
|
|
$selectedAssignableRoleIds,
|
|
|
|
|
$isReadOnly,
|
|
|
|
|
'description',
|
|
|
|
|
null,
|
|
|
|
|
[
|
|
|
|
|
'emptyState' => t('No roles selected'),
|
|
|
|
|
'removeTooltip' => t('Remove role'),
|
|
|
|
|
]
|
|
|
|
|
); ?>
|
2026-03-13 21:11:48 +01:00
|
|
|
<?php else: ?>
|
|
|
|
|
<?php
|
|
|
|
|
$emptyState = [
|
|
|
|
|
'message' => t('No roles available'),
|
|
|
|
|
'hint' => t('No active roles are configured yet.'),
|
|
|
|
|
'size' => 'compact',
|
|
|
|
|
];
|
|
|
|
|
require templatePath('partials/app-empty-state.phtml');
|
|
|
|
|
?>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
</div>
|
|
|
|
|
|
add composer-unused, comprehensive docs, and project restructure
- Add icanhazstring/composer-unused as dev dependency for dependency hygiene checks
- Add German documentation (docs/) covering architecture, conventions, workflows, and developer checklists
- Add API layer (ApiAuth, ApiBootstrap, ApiResponse), audit, scheduler, custom fields, and SSO services
- Add Microsoft OIDC SSO, API token management, and user lifecycle features
- Add swagger-ui vendor integration and OpenAPI spec
- Add production Docker setup and bin/ scripts
- Update composer dependencies, config, templates, and frontend assets throughout
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 15:27:35 +01:00
|
|
|
<div data-tab-panel="visibility">
|
|
|
|
|
<?php
|
|
|
|
|
$statusFieldName = 'active';
|
|
|
|
|
$statusFieldId = 'role-active';
|
|
|
|
|
$statusFieldValue = (string) ($values['active'] ?? '1');
|
|
|
|
|
require templatePath('partials/app-visibility-status-field.phtml');
|
|
|
|
|
?>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<?php if ($showDangerZone && $dangerZoneDeleteFormId !== ''): ?>
|
|
|
|
|
<div data-tab-panel="danger">
|
|
|
|
|
<?php
|
|
|
|
|
$dangerFormId = $dangerZoneDeleteFormId;
|
|
|
|
|
$dangerLegend = t('Delete');
|
|
|
|
|
$dangerWarning = $dangerZoneWarning;
|
|
|
|
|
$dangerButtonLabel = $dangerZoneActionLabel;
|
|
|
|
|
require templatePath('partials/app-danger-zone-delete-field.phtml');
|
|
|
|
|
?>
|
|
|
|
|
</div>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
</div>
|
2026-02-04 23:31:53 +01:00
|
|
|
<?php Session::getCsrfInput(); ?>
|
|
|
|
|
</form>
|