1<?php 2 3use Fisharebest\Webtrees\Source; 4use Fisharebest\Webtrees\Tree; 5 6/** 7 * @var Source|null $source 8 * @var string|null $id 9 * @var string $name 10 * @var Tree $tree 11 */ 12 13?> 14 15<select 16 autocomplete="off" 17 class="form-control select2" 18 data-ajax--delay="350" 19 data-ajax--minimum-input-length="2" 20 data-ajax--type="POST" 21 data-ajax--url="<?= e(route('select2-source', ['ged' => $tree->name()])) ?>" 22 data-allow-clear="true" 23 id="<?= e($id ?? $name) ?>" 24 name="<?= e($name) ?>" 25 <?= ($disabled ?? false) ? 'disabled' : '' ?> 26 <?= ($required ?? false) ? 'required' : '' ?> 27> 28 <?php if (($source ?? null) instanceof Source): ?> 29 <option value="<?= e($source->xref()) ?>" selected> 30 <?= view('selects/source', ['source' => $source]) ?> 31 </option> 32 <?php else: ?> 33 <option></option> 34 <?php endif ?> 35</select> 36