Files
plugi/extensions/plugi-ext-form/admin/Views/ListForms.php
T
deepDiverPaul 80e60d6823 translate form extension UI to English
Replace German labels, prompts, validation messages, and submission text across the form admin and block views with English.
Remove redundant LICENSE files from the form and sitemap extensions.
2026-11-24 10:56:44 +01:00

73 lines
3.5 KiB
PHP

<?php
use Plugi\Extensions\Form\DefinitionsRepository;
$formsRepository = new DefinitionsRepository();
$forms = $formsRepository->getAll();
?>
<div class="flex items-center justify-between mb-6">
<div>
<h2 class="text-xl font-bold">Forms</h2>
<p class="text-sm text-base-content/60"><?= count($forms) ?> form<?= count($forms) !== 1 ? 's' : '' ?> available</p>
</div>
<a href="<?= phpb_url('website_manager', ['tab' => 'ext--form', 'action' => 'editForm']) ?>" class="btn btn-primary btn-sm">
<i class="ph-duotone ph-plus"></i>
New form
</a>
</div>
<?php if (empty($forms)): ?>
<div class="card bg-base-100 shadow">
<div class="card-body items-center text-center py-16">
<i class="ph-duotone ph-notebook text-6xl text-base-content/20"></i>
<h3 class="card-title text-lg mt-4">No forms yet</h3>
<p class="text-base-content/60 mt-1">Create your first form to collect submissions from your website.</p>
<a href="<?= phpb_url('website_manager', ['tab' => 'ext--form', 'action' => 'editForm']) ?>" class="btn btn-primary mt-4">
<i class="ph-duotone ph-plus"></i>
Create your first form
</a>
</div>
</div>
<?php else: ?>
<div class="card bg-base-100 shadow">
<div class="card-body p-0">
<div class="overflow-x-auto">
<table class="table w-full">
<thead>
<tr class="bg-base-200/50">
<th class="w-16">ID</th>
<th><?= phpb_trans('website-manager.name') ?></th>
<th class="w-16 text-center"><?= phpb_trans('website-manager.actions') ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($forms as $form): ?>
<tr class="hover:bg-base-200/30">
<td class="font-mono text-sm text-base-content/60"><?= phpb_e($form['id']) ?></td>
<td>
<div class="font-medium"><?= phpb_e($form['name']) ?></div>
</td>
<td>
<div class="flex items-center justify-center gap-1">
<a href="<?= phpb_url('website_manager', ['tab' => 'ext--form', 'action' => 'listEntries', 'id' => $form['id']]) ?>" class="btn btn-ghost btn-sm btn-circle" title="View entries">
<i class="ph-duotone ph-eye text-lg"></i>
</a>
<a href="<?= phpb_url('website_manager', ['tab' => 'ext--form', 'action' => 'editForm', 'id' => $form['id']]) ?>" class="btn btn-ghost btn-sm btn-circle" title="<?= phpb_trans('website-manager.edit') ?>">
<i class="ph-duotone ph-pencil-line text-lg"></i>
</a>
<a href="/ext--form/delete-form?id=<?= $form['id'] ?>" class="btn btn-ghost btn-sm btn-circle text-error" title="<?= phpb_trans('website-manager.remove') ?>">
<i class="ph-duotone ph-trash text-lg"></i>
</a>
</div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
<?php endif; ?>