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