xref: /webtrees/resources/views/search-advanced-field.phtml (revision 26420f84cb96928cdc566963a4499db677a38ff9)
1<?php
2
3use Fisharebest\Webtrees\GedcomTag;
4
5/**
6 * @var string[] $date_options
7 * @var string   $field_name
8 * @var string   $field_value
9 * @var string   $modifier
10 * @var string[] $name_options
11 */
12
13?>
14
15<div class="row form-group">
16    <label class="col-sm-3 col-form-label wt-page-options-label" for="fields[<?= e($field_name) ?>]">
17        <?= GedcomTag::getLabel($field_name) ?>
18    </label>
19
20    <div class="col-sm-6 wt-page-options-value">
21        <input class="form-control form-control" type="text" id="fields[<?= e($field_name) ?>]" name="fields[<?= e($field_name) ?>]" value="<?= e($field_value) ?>" <?php if (substr($field_name, -5) === ':DATE'): ?>onchange="valid_date(this, 'dmy')" <?php endif ?>>
22    </div>
23
24    <div class="col-sm-3 wt-page-options-value">
25        <?php if (preg_match('/(GIVN|SURN)$/', $field_name)) : ?>
26            <?= view('components/select', ['name' => 'modifiers[' . $field_name . ']', 'id' => 'modifiers-' . $field_name, 'selected' => $modifier, 'options' => $name_options]) ?>
27        <?php endif ?>
28
29        <?php if (preg_match('/(DATE)$/', $field_name)) : ?>
30            <?= view('components/select', ['name' => 'modifiers[' . $field_name . ']', 'id' => 'modifiers-' . $field_name, 'selected' => $modifier, 'options' => $date_options]) ?>
31        <?php endif ?>
32    </div>
33</div>
34