xref: /webtrees/resources/views/components/select-submitter.phtml (revision 1cec98da4520070cd9aa24653f7ca054b7a979a5)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\AbstractTomSelectHandler;
4use Fisharebest\Webtrees\Submitter;
5use Fisharebest\Webtrees\Http\RequestHandlers\TomSelectSubmitter;
6use Fisharebest\Webtrees\Tree;
7
8/**
9 * @var string      $at     "@" or "" (or unset).
10 * @var Submitter|null $submitter
11 * @var string|null       $class
12 * @var string|null       $id
13 * @var string            $name
14 * @var Tree              $tree
15 */
16
17$at = $at ?? '';
18
19?>
20
21<select
22    autocomplete="off"
23    class="form-select tom-select <?= $class ?? '' ?>"
24    data-url="<?= e(route(TomSelectSubmitter::class, ['tree' => $tree->name(), 'at' => $at])) ?>"
25    id="<?= e($id ?? $name) ?>"
26    name="<?= e($name) ?>"
27    <?= ($disabled ?? false) ? 'disabled="disabled"' : '' ?>
28    <?= ($required ?? false) ? 'required="required"' : '' ?>
29>
30    <?php if (($submitter ?? null) instanceof Submitter) : ?>
31        <option value="<?= e($at . $submitter->xref() . $at) ?>">
32            <?= view('selects/submitter', ['submitter' => $submitter]) ?>
33        </option>
34    <?php else : ?>
35        <option value="">&nbsp;</option>
36    <?php endif ?>
37</select>
38