Files
plugi/extensions/plugi-ext-form/admin/form.php
T
deepDiverPaul 151ac9df4c refresh form extension admin interface
Improve form editing, settings, submission lists, and navigation with responsive layouts and accessibility enhancements. Update the form wrapper block view and regenerate the extension stylesheet. Ignore .agents and skills-lock.json.
2026-11-25 09:59:51 +01:00

61 lines
1.7 KiB
PHP

<?php
$modules = [
'listForms' => [
'include' => __DIR__ . '/Views/ListForms.php',
'label' => 'Forms',
'icon' => 'ph-list-dashes',
'showTabs' => true,
'inMenu' => true,
],
'settings' => [
'include' => __DIR__ . '/Views/ExtSettings.php',
'label' => 'Settings',
'icon' => 'ph-gear',
'showTabs' => true,
'inMenu' => true,
],
'editForm' => [
'include' => __DIR__ . '/Views/EditForm.php',
'showTabs' => false,
'inMenu' => false,
],
'listEntries' => [
'include' => __DIR__ . '/Views/ListEntries.php',
'showTabs' => false,
'inMenu' => false,
],
];
$activeModule = array_keys($modules)[0];
if (isset($_GET['action']) && array_key_exists($_GET['action'], $modules)) $activeModule = $_GET['action'];
?>
<?php
if ($modules[$activeModule]['showTabs'] === true):
?>
<nav class="mb-6 overflow-x-auto" aria-label="Form extension navigation">
<div class="tabs tabs-boxed w-max min-w-full bg-base-200/50">
<?php
foreach ($modules as $name => $module):
if ($module['inMenu'] === false) continue;
$icon = $module['icon'] ?? 'ph-circle';
?>
<a class="tab gap-2 <?= $name === $activeModule ? 'tab-active' : '' ?>" <?= $name === $activeModule ? 'aria-current="page"' : '' ?> href="<?= phpb_url('website_manager', ['tab' => 'ext--form', 'action' => $name]) ?>">
<i class="ph-duotone <?= $icon ?>"></i>
<?= $module['label'] ?>
</a>
<?php
endforeach;
?>
</div>
</nav>
<?php
endif;
?>
<div class="w-full">
<?php
include $modules[$activeModule]['include'];
?>
</div>