summaryrefslogtreecommitdiff
path: root/resources
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-03-25 16:55:07 +0000
committerGreg Roach <fisharebest@webtrees.net>2019-03-26 15:59:06 +0000
commitb6c326d8b8798b83b744c4d4a669df5aa9f3e0c2 (patch)
tree4c59773e6195d2a8fed78db9f833840a127fb009 /resources
parent2b29a33ec689ba87b1fb556ab9b17db481593ad9 (diff)
downloadwebtrees-b6c326d8b8798b83b744c4d4a669df5aa9f3e0c2.tar.gz
webtrees-b6c326d8b8798b83b744c4d4a669df5aa9f3e0c2.tar.bz2
webtrees-b6c326d8b8798b83b744c4d4a669df5aa9f3e0c2.zip
Replace Bootstrap4 class with views
Diffstat (limited to 'resources')
-rwxr-xr-xresources/css/clouds.css1
-rw-r--r--resources/css/colors.css1
-rwxr-xr-xresources/css/fab.css1
-rwxr-xr-xresources/css/minimal.css1
-rwxr-xr-xresources/css/webtrees.css1
-rwxr-xr-xresources/css/xenea.css1
-rw-r--r--resources/views/admin/changes-log.phtml7
-rw-r--r--resources/views/admin/components.phtml4
-rw-r--r--resources/views/admin/location-edit.phtml7
-rw-r--r--resources/views/admin/locations.phtml7
-rw-r--r--resources/views/admin/map-import-form.phtml26
-rw-r--r--resources/views/admin/map-provider.phtml11
-rw-r--r--resources/views/admin/media.phtml49
-rw-r--r--resources/views/admin/merge-records-step-1.phtml36
-rw-r--r--resources/views/admin/modules.phtml12
-rw-r--r--resources/views/admin/site-logs.phtml16
-rw-r--r--resources/views/admin/site-mail.phtml8
-rw-r--r--resources/views/admin/site-preferences.phtml8
-rw-r--r--resources/views/admin/site-registration.phtml8
-rw-r--r--resources/views/admin/trees-merge.phtml5
-rw-r--r--resources/views/admin/trees-preferences.phtml107
-rw-r--r--resources/views/admin/trees-privacy.phtml38
-rw-r--r--resources/views/admin/trees-unconnected.phtml3
-rw-r--r--resources/views/admin/users-cleanup.phtml4
-rw-r--r--resources/views/admin/users-edit.phtml24
-rw-r--r--resources/views/admin/users.phtml10
-rw-r--r--resources/views/branches-page.phtml5
-rw-r--r--resources/views/chart-box.phtml6
-rw-r--r--resources/views/components/checkbox-inline.phtml25
-rw-r--r--resources/views/components/checkbox.phtml25
-rw-r--r--resources/views/components/radio-inline.phtml27
-rw-r--r--resources/views/components/radio.phtml25
-rw-r--r--resources/views/components/radios-hide-show.phtml15
-rw-r--r--resources/views/components/radios-inline.phtml13
-rw-r--r--resources/views/components/radios-no-yes.phtml15
-rw-r--r--resources/views/components/radios.phtml13
-rw-r--r--resources/views/components/select-family.phtml35
-rw-r--r--resources/views/components/select-individual.phtml35
-rw-r--r--resources/views/components/select-media.phtml35
-rw-r--r--resources/views/components/select-note.phtml35
-rw-r--r--resources/views/components/select-repository.phtml35
-rw-r--r--resources/views/components/select-source.phtml35
-rw-r--r--resources/views/components/select-submitter.phtml35
-rw-r--r--resources/views/components/select.phtml24
-rw-r--r--resources/views/edit-account-page.phtml15
-rw-r--r--resources/views/edit/add-fact.phtml3
-rw-r--r--resources/views/edit/change-family-members.phtml9
-rw-r--r--resources/views/edit/edit-fact.phtml3
-rw-r--r--resources/views/edit/link-child-to-family.phtml6
-rw-r--r--resources/views/edit/link-spouse-to-individual.phtml2
-rw-r--r--resources/views/edit/new-individual.phtml1
-rw-r--r--resources/views/interactive-tree-page.phtml3
-rw-r--r--resources/views/layouts/default.phtml5
-rw-r--r--resources/views/lists/datatables-attributes.phtml2
-rw-r--r--resources/views/lists/families-table.phtml9
-rw-r--r--resources/views/lists/individuals-table.phtml9
-rw-r--r--resources/views/media-list-page.phtml9
-rw-r--r--resources/views/modals/create-family.phtml5
-rw-r--r--resources/views/modals/create-media-from-file.phtml3
-rw-r--r--resources/views/modals/link-media-to-family.phtml3
-rw-r--r--resources/views/modals/link-media-to-individual.phtml3
-rw-r--r--resources/views/modals/link-media-to-source.phtml3
-rw-r--r--resources/views/modals/media-file-fields.phtml5
-rw-r--r--resources/views/modals/source-fields.phtml3
-rw-r--r--resources/views/modules/ancestors-chart/page.phtml8
-rw-r--r--resources/views/modules/batch_update/admin.phtml28
-rw-r--r--resources/views/modules/census-assistant.phtml25
-rw-r--r--resources/views/modules/charts/config.phtml6
-rw-r--r--resources/views/modules/clippings/add-options.phtml3
-rw-r--r--resources/views/modules/compact-chart/page.phtml3
-rw-r--r--resources/views/modules/descendancy_chart/page.phtml6
-rw-r--r--resources/views/modules/family-book-chart/page.phtml9
-rw-r--r--resources/views/modules/fanchart/page.phtml7
-rw-r--r--resources/views/modules/faq/config.phtml3
-rw-r--r--resources/views/modules/faq/edit.phtml3
-rw-r--r--resources/views/modules/faq/list.phtml48
-rw-r--r--resources/views/modules/favorites/favorites.phtml15
-rw-r--r--resources/views/modules/gedcom_stats/config.phtml41
-rw-r--r--resources/views/modules/hourglass-chart/page.phtml7
-rw-r--r--resources/views/modules/html/config.phtml15
-rw-r--r--resources/views/modules/lifespans-chart/page.phtml10
-rw-r--r--resources/views/modules/pedigree-chart/page.phtml11
-rw-r--r--resources/views/modules/pedigree-map/page.phtml11
-rw-r--r--resources/views/modules/random_media/config.phtml13
-rw-r--r--resources/views/modules/recent_changes/config.phtml8
-rw-r--r--resources/views/modules/relationships-chart/config.phtml5
-rw-r--r--resources/views/modules/relationships-chart/page.phtml16
-rw-r--r--resources/views/modules/review_changes/config.phtml4
-rw-r--r--resources/views/modules/sitemap/config.phtml3
-rw-r--r--resources/views/modules/statistics-chart/custom.phtml267
-rw-r--r--resources/views/modules/stories/config.phtml3
-rw-r--r--resources/views/modules/stories/edit.phtml2
-rw-r--r--resources/views/modules/stories/list.phtml24
-rw-r--r--resources/views/modules/timeline-chart/page.phtml6
-rw-r--r--resources/views/modules/todays_events/config.phtml10
-rw-r--r--resources/views/modules/todo/config.phtml8
-rw-r--r--resources/views/modules/top10_givnnames/config.phtml3
-rw-r--r--resources/views/modules/top10_pageviews/config.phtml3
-rw-r--r--resources/views/modules/top10_surnames/config.phtml3
-rw-r--r--resources/views/modules/upcoming_events/config.phtml10
-rw-r--r--resources/views/modules/yahrzeit/config.phtml5
-rw-r--r--resources/views/search-advanced-field.phtml5
-rw-r--r--resources/views/search-advanced-page.phtml3
-rw-r--r--resources/views/search-replace-page.phtml3
104 files changed, 921 insertions, 677 deletions
diff --git a/resources/css/clouds.css b/resources/css/clouds.css
index b980ccb463..370ee7b8af 100755
--- a/resources/css/clouds.css
+++ b/resources/css/clouds.css
@@ -2201,6 +2201,7 @@ div.faq_body {
/*-- Fan chart ---- */
.fan_chart_menu {
+ background: #fff;
position: absolute;
display: none;
z-index: 100;
diff --git a/resources/css/colors.css b/resources/css/colors.css
index 11638e3739..e83500dbdd 100644
--- a/resources/css/colors.css
+++ b/resources/css/colors.css
@@ -2059,6 +2059,7 @@ div.faq_body {
/*-- Fan chart ---- */
.fan_chart_menu {
+ background: #fff;
position: absolute;
display: none;
z-index: 100;
diff --git a/resources/css/fab.css b/resources/css/fab.css
index 902cc377b4..5826b8432f 100755
--- a/resources/css/fab.css
+++ b/resources/css/fab.css
@@ -1786,6 +1786,7 @@ div.faq_body {
/*-- Fan chart ---- */
.fan_chart_menu {
+ background: #fff;
position: absolute;
display: none;
z-index: 100;
diff --git a/resources/css/minimal.css b/resources/css/minimal.css
index 8dc8fae6b6..03a8ff43cd 100755
--- a/resources/css/minimal.css
+++ b/resources/css/minimal.css
@@ -1512,6 +1512,7 @@ div.faq_body {
/*-- Fan chart ---- */
.fan_chart_menu {
+ background: #fff;
position: absolute;
display: none;
z-index: 100;
diff --git a/resources/css/webtrees.css b/resources/css/webtrees.css
index e73b6aafd6..fbb6ae36d2 100755
--- a/resources/css/webtrees.css
+++ b/resources/css/webtrees.css
@@ -2128,6 +2128,7 @@ div.faq_body {
/*-- Fan chart ---- */
.fan_chart_menu {
+ background: #fff;
position: absolute;
display: none;
z-index: 100;
diff --git a/resources/css/xenea.css b/resources/css/xenea.css
index a2fd38ef41..3be7b54a60 100755
--- a/resources/css/xenea.css
+++ b/resources/css/xenea.css
@@ -2074,6 +2074,7 @@ div.faq_body {
/*-- Fan chart ---- */
.fan_chart_menu {
+ background: #fff;
position: absolute;
display: none;
z-index: 100;
diff --git a/resources/views/admin/changes-log.phtml b/resources/views/admin/changes-log.phtml
index def61e8b09..23ab11b443 100644
--- a/resources/views/admin/changes-log.phtml
+++ b/resources/views/admin/changes-log.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('admin-trees') => I18N::translate('Manage family trees'), $title]]) ?>
@@ -29,7 +28,7 @@
<label for="type">
<?= I18N::translate('Status') ?>
</label>
- <?= Bootstrap4::select($statuses, $type, ['id' => 'type', 'name' => 'type']) ?>
+ <?= view('components/select', ['name' => 'type', 'selected' => $type, 'values' => $statuses]) ?>
</div>
<div class="form-group col-xs-6 col-md-3">
@@ -59,14 +58,14 @@
<label for="username">
<?= I18N::translate('User') ?>
</label>
- <?= Bootstrap4::select($user_list, $username, ['id' => 'username', 'name' => 'username']) ?>
+ <?= view('components/select', ['name' => 'username', 'selected' => $username, 'values' => $user_list]) ?>
</div>
<div class="form-group col-xs-6 col-md-3">
<label for="ged">
<?= I18N::translate('Family tree') ?>
</label>
- <?= Bootstrap4::select($tree_list, $ged, ['id' => 'ged', 'name' => 'ged']) ?>
+ <?= view('components/select', ['name' => 'ged', 'selected' => $ged, 'values' => $tree_list]) ?>
</div>
</div>
diff --git a/resources/views/admin/components.phtml b/resources/views/admin/components.phtml
index 2b2e4c0ae5..a8eac859f2 100644
--- a/resources/views/admin/components.phtml
+++ b/resources/views/admin/components.phtml
@@ -1,6 +1,5 @@
<?php
-use Fisharebest\Webtrees\Bootstrap4;
use Fisharebest\Webtrees\Functions\FunctionsEdit;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Module\ModuleConfigInterface;
@@ -88,8 +87,7 @@ use Fisharebest\Webtrees\View;
<?= e($tree->title()) ?>
</td>
<td>
- <?= Bootstrap4::select(FunctionsEdit::optionsAccessLevels(), $module->accessLevel($tree, $interface), ['name' => 'access-' . $module->name() . '-' . $tree->id()]) ?>
- </td>
+ <?= view('components/select', ['name' => 'access-' . $module->name() . '-' . $tree->id(), 'selected' => $module->accessLevel($tree, $interface), 'values' => FunctionsEdit::optionsAccessLevels()]) ?>
</tr>
<?php endforeach ?>
</tbody>
diff --git a/resources/views/admin/location-edit.phtml b/resources/views/admin/location-edit.phtml
index 4c123ab6f1..67366822c8 100644
--- a/resources/views/admin/location-edit.phtml
+++ b/resources/views/admin/location-edit.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?php use Fisharebest\Webtrees\View; ?>
@@ -32,11 +31,7 @@
</label>
<div class="col-sm-4">
<div class="input-group" dir="ltr">
- <?= FunctionsEdit::formControlFlag(
- $location->icon(),
- ['name' => 'icon', 'id' => 'icon', 'class' => 'form-control']
- )
-?>
+ <input type="text" name="icon" id="icon" class="form-control" value="<?= e($location->icon()) ?>">
</div>
</div>
</div>
diff --git a/resources/views/admin/locations.phtml b/resources/views/admin/locations.phtml
index ebe92d7144..67ac126234 100644
--- a/resources/views/admin/locations.phtml
+++ b/resources/views/admin/locations.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?php use Fisharebest\Webtrees\Tree; ?>
<?php use Fisharebest\Webtrees\Webtrees; ?>
@@ -130,11 +129,7 @@
<?= I18N::translate('Import all places from a family tree') ?>
</label>
<div class="col-sm-6">
- <?= Bootstrap4::select(
- Tree::getNameList(),
- '',
- ['id' => 'ged', 'name' => 'ged']
- ) ?>
+ <?= view('components/select', ['name' => 'ged', 'selected' => '', 'values' => Tree::getNameList()]) ?>
</div>
<div class="col-sm-2">
<button type="submit" class="btn btn-primary">
diff --git a/resources/views/admin/map-import-form.phtml b/resources/views/admin/map-import-form.phtml
index 2bb292d9d5..ae431bf131 100644
--- a/resources/views/admin/map-import-form.phtml
+++ b/resources/views/admin/map-import-form.phtml
@@ -1,6 +1,9 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
-<?php use Fisharebest\Webtrees\I18N; ?>
-<?php use Fisharebest\Webtrees\View; ?>
+<?php
+
+use Fisharebest\Webtrees\I18N;
+use Fisharebest\Webtrees\View;
+
+?>
<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('map-data') => I18N::translate('Geographic data'), $title]]) ?>
@@ -50,12 +53,7 @@
<?= I18N::translate('Delete all existing geographic data before importing the file.') ?>
</legend>
<div class="col-sm-8">
- <?= Bootstrap4::radioButtons(
- 'cleardatabase',
- [I18N::translate('no'), I18N::translate('yes')],
- '0',
- true
- ) ?>
+ <?= view('components/radios-inline', ['name' => 'cleardatabase', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => false]) ?>
</div>
</div>
</fieldset>
@@ -67,15 +65,7 @@
<?= I18N::translate('Import Options.') ?>
</legend>
<div class="col-sm-8">
- <?= Bootstrap4::select(
- [
- 'addupdate' => I18N::translate('Add new, and update existing records'),
- 'add' => I18N::translate('Only add new records'),
- 'update' => I18N::translate('Only update existing records'),
- ],
- '0',
- ['id' => 'import-options', 'name' => 'import-options']
- ) ?>
+ <?= view('components/select', ['name' => 'import-options', 'selected' => '', 'values' => ['addupdate' => I18N::translate('Add new, and update existing records'), 'add' => I18N::translate('Only add new records'), 'update' => I18N::translate('Only update existing records')]]) ?>
</div>
</div>
</fieldset>
diff --git a/resources/views/admin/map-provider.phtml b/resources/views/admin/map-provider.phtml
index 8f378c1fd9..a7458f38e4 100644
--- a/resources/views/admin/map-provider.phtml
+++ b/resources/views/admin/map-provider.phtml
@@ -7,13 +7,14 @@
<div class="form-group">
<div class="form-row">
- <div class="col-form-label col-sm-3">
+ <label class="col-form-label col-sm-3" for="provider-default">
<?= I18N::translate('Map provider') ?>
- </div>
+ </label>
<div class="col-sm-9">
- <?= view('components/radio', ['id' => 'provider-default', 'name' => 'provider', 'value' => '', 'checked' => $provider === '', 'text' => 'Do not use maps']) ?>
- <hr>
- <?= view('components/radio', ['id' => 'provider-openstreetmap', 'name' => 'provider', 'value' => 'OpenStreetMap.Mapnik', 'checked' => $provider === 'OpenStreetMap.Mapnik', 'text' => 'OpenStreetMap']) ?>
+ <?= view('components/radios', ['name' => 'provider-default', 'selected' => $provider, 'options' => [
+ '' => I18N::translate('Do not use maps'),
+ 'i' => I18N::translate('OpenStreetMap™'),
+ ]]) ?>
<hr>
<!-- @TODO - other mapping providers (may need API keys, etc.) -->
</div>
diff --git a/resources/views/admin/media.phtml b/resources/views/admin/media.phtml
index 4ce89513bf..7b83910c15 100644
--- a/resources/views/admin/media.phtml
+++ b/resources/views/admin/media.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?php use Fisharebest\Webtrees\View; ?>
@@ -6,7 +5,7 @@
<h1><?= $title ?></h1>
-<form>
+<form id="admin-media-form">
<input type="hidden" name="route" value="admin-media">
<table class="table table-bordered table-sm">
<thead>
@@ -19,38 +18,43 @@
<tr>
<td>
<label>
- <input type="radio" name="files" value="local" <?= $files === 'local' ? 'checked' : '' ?> onchange="this.form.submit();">
+ <input type="radio" name="files" value="local" <?= $files === 'local' ? 'checked' : '' ?>>
<?= /* I18N: “Local files” are stored on this computer */ I18N::translate('Local files') ?>
</label>
<br>
<label>
- <input type="radio" name="files" value="external" <?= $files === 'external' ? 'checked' : '' ?> onchange="this.form.submit();">
+ <input type="radio" name="files" value="external" <?= $files === 'external' ? 'checked' : '' ?>>
<?= /* I18N: “External files” are stored on other computers */ I18N::translate('External files') ?>
</label>
<br>
<label>
- <input type="radio" name="files" value="unused" <?= $files === 'unused' ? 'checked' : '' ?> onchange="this.form.submit();">
+ <input type="radio" name="files" value="unused" <?= $files === 'unused' ? 'checked' : '' ?>>
<?= I18N::translate('Unused files') ?>
</label>
</td>
<td>
<?php if ($files === 'local' || $files === 'unused') : ?>
- <div dir="ltr" class="form-inline">
- <?php if (count($media_folders) > 1) : ?>
- <?= e($data_folder) . Bootstrap4::select($media_folders, $media_folder, ['name' => 'media_folder', 'onchange' => 'this.form.submit();']) ?>
- <?php else : ?>
- <?= e($data_folder) . e($media_folder) ?>
- <input type="hidden" name="media_folder" value="<?= e($media_folder) ?>">
- <?php endif ?>
+ <div class="input-group mb-2" dir="ltr">
+ <div class="input-group-prepend">
+ <div class="input-group-text"><?= e($data_folder) ?></div>
+ </div>
+ <?php if ($media_folders->count() > 1) : ?>
+ <?= view('components/select', ['name' => 'media_folder', 'selected' => $media_folder, 'values' => $media_folders]) ?>
+
+ <?php else : ?>
+ <?= e($media_folder) ?>
+ <input type="hidden" name="media_folder" value="<?= e($media_folder) ?>">
+ <?php endif ?>
+ </div>
</div>
<label>
- <input type="radio" name="subfolders" value="include" <?= $subfolders === 'include' ? 'checked' : '' ?> onchange="this.form.submit();">
+ <input type="radio" name="subfolders" value="include" <?= $subfolders === 'include' ? 'checked' : '' ?>>
<?= I18N::translate('Include subfolders') ?>
</label>
<br>
<label>
- <input type="radio" name="subfolders" value="exclude" <?= $subfolders === 'exclude' ? ' checked' : '' ?> onchange="this.form.submit();">
+ <input type="radio" name="subfolders" value="exclude" <?= $subfolders === 'exclude' ? ' checked' : '' ?>>
<?= I18N::translate('Exclude subfolders') ?>
</label>
@@ -67,7 +71,10 @@
<br>
<br>
-<table class="table table-bordered table-sm" id="media-table-<?= e($table_id) ?>" data-ajax="<?= e(route('admin-media-data', ['files' => $files, 'media_folder' => $media_folder, 'subfolders' => $subfolders])) ?>">
+<table class="table table-bordered table-sm" id="media-table-<?= e($table_id) ?>"
+ <?= view('lists/datatables-attributes') ?>
+ data-ajax="<?= e(route('admin-media-data', ['files' => $files, 'media_folder' => $media_folder, 'subfolders' => $subfolders])) ?>"
+>
<thead>
<tr>
<th><?= I18N::translate('Media file') ?></th>
@@ -80,23 +87,21 @@
</table>
<?= view('modals/create-media-from-file') ?>
-
<?php View::push('javascript') ?>
<script>
+ $("#admin-media-form input, #admin-media-form select").change(function () {
+ $("#admin-media-form").submit();
+ });
+
$("#media-table-<?= e($table_id) ?>").dataTable({
processing: true,
serverSide: true,
autoWidth: false,
- pageLength: 10,
- pagingType: "full_numbers",
- stateSave: true,
- stateDuration: 300,
columns: [
{},
{sortable: false},
{sortable: <?= $files === 'unused' ? 'false' : 'true' ?>}
- ],
- <?= I18N::datatablesI18N([5, 10, 20, 50, 100, 500, 1000, -1]) ?>
+ ]
});
</script>
<?php View::endpush() ?>
diff --git a/resources/views/admin/merge-records-step-1.phtml b/resources/views/admin/merge-records-step-1.phtml
index c029598270..eedcb2789d 100644
--- a/resources/views/admin/merge-records-step-1.phtml
+++ b/resources/views/admin/merge-records-step-1.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?php use Fisharebest\Webtrees\View; ?>
@@ -30,22 +29,22 @@
<?= I18N::translate('First record') ?>
</span>
<span class="col-sm-9 select-record select-individual">
- <?= FunctionsEdit::formControlIndividual($tree, $individual1, ['name' => 'xref1', 'class' => 'form-control', 'style' => 'width:100%;']) ?>
+ <?= view('components/select-individual', ['name' => 'xref1', 'id' => 'indi-xref-1', 'individual' => $individual1, 'tree' => $tree]) ?>
</span>
<span class="col-sm-9 select-record select-family d-none">
- <?= FunctionsEdit::formControlFamily($tree, $family1, ['name' => 'xref1', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
+ <?= view('components/select-family', ['name' => 'xref1', 'id' => 'fam-xref-1', 'family' => $family1, 'tree' => $tree, 'disabled' => true]) ?>
</span>
<span class="col-sm-9 select-record select-source d-none">
- <?= FunctionsEdit::formControlSource($tree, $source1, ['name' => 'xref1', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
+ <?= view('components/select-source', ['name' => 'xref1', 'id' => 'sour-xref-1', 'source' => $source1, 'tree' => $tree, 'disabled' => true]) ?>
</span>
<span class="col-sm-9 select-record select-repository d-none">
- <?= FunctionsEdit::formControlRepository($tree, $repository1, ['name' => 'xref1', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
+ <?= view('components/select-repository', ['name' => 'xref1', 'id' => 'repo-xref-1', 'repository' => $repository1, 'tree' => $tree, 'disabled' => true]) ?>
</span>
<span class="col-sm-9 select-record select-note d-none">
- <?= FunctionsEdit::formControlNote($tree, $note1, ['name' => 'xref1', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
+ <?= view('components/select-note', ['name' => 'xref1', 'id' => 'note-xref-1', 'note' => $note1, 'tree' => $tree, 'disabled' => true]) ?>
</span>
<span class="col-sm-9 select-record select-media d-none">
- <?= FunctionsEdit::formControlMediaObject($tree, $media2, ['name' => 'xref1', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
+ <?= view('components/select-media', ['name' => 'xref1', 'id' => 'media-xref-1', 'media' => $media1, 'tree' => $tree, 'disabled' => true]) ?>
</span>
</label>
@@ -54,22 +53,22 @@
<?= I18N::translate('Second record') ?>
</span>
<span class="col-sm-9 select-record select-individual">
- <?= FunctionsEdit::formControlIndividual($tree, $individual2, ['name' => 'xref2', 'class' => 'form-control', 'style' => 'width:100%;']) ?>
+ <?= view('components/select-individual', ['name' => 'xref2', 'id' => 'indi-xref-2', 'individual' => $individual2, 'tree' => $tree]) ?>
</span>
<span class="col-sm-9 select-record select-family d-none">
- <?= FunctionsEdit::formControlFamily($tree, $family2, ['name' => 'xref2', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
+ <?= view('components/select-family', ['name' => 'xref2', 'id' => 'fam-xref-2', 'family' => $family2, 'tree' => $tree, 'disabled' => true]) ?>
</span>
<span class="col-sm-9 select-record select-source d-none">
- <?= FunctionsEdit::formControlSource($tree, $source2, ['name' => 'xref2', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
+ <?= view('components/select-source', ['name' => 'xref2', 'id' => 'sour-xref-2', 'source' => $source2, 'tree' => $tree, 'disabled' => true]) ?>
</span>
<span class="col-sm-9 select-record select-repository d-none">
- <?= FunctionsEdit::formControlRepository($tree, $repository2, ['name' => 'xref2', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
+ <?= view('components/select-repository', ['name' => 'xref2', 'id' => 'repo-xref-2', 'repository' => $repository2, 'tree' => $tree, 'disabled' => true]) ?>
</span>
<span class="col-sm-9 select-record select-note d-none">
- <?= FunctionsEdit::formControlNote($tree, $note2, ['name' => 'xref2', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
+ <?= view('components/select-note', ['name' => 'xref2', 'id' => 'note-xref-2', 'note' => $note2, 'tree' => $tree, 'disabled' => true]) ?>
</span>
<span class="col-sm-9 select-record select-media d-none">
- <?= FunctionsEdit::formControlMediaObject($tree, $media2, ['name' => 'xref2', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
+ <?= view('components/select-media', ['name' => 'xref2', 'id' => 'obje-xref-2', 'media' => $media2, 'tree' => $tree, 'disabled' => true]) ?>
</span>
</label>
@@ -87,13 +86,14 @@
<?php View::push('javascript') ?>
<script>
- 'use strict';
+ "use strict";
// Disabled elements do not get submitted with the form.
- $('#record-type').change(function() {
- $('.select-record').addClass('d-none').attr("disabled", true);
- $('.select-' + $(this).val()).removeClass('d-none').attr("disabled", false);
- // Recalculate width of previously hidden elements
+ $("#record-type").change(function() {
+ $(".select-record").addClass('d-none');
+ $(".select-" + $(this).val()).removeClass('d-none');
+ $(".select-record select").attr("disabled", true);
+ $(".select-" + $(this).val() + " select").attr("disabled", false);
});
</script>
<?php View::endpush() ?>
diff --git a/resources/views/admin/modules.phtml b/resources/views/admin/modules.phtml
index 8a033bb8d8..18b5c6e829 100644
--- a/resources/views/admin/modules.phtml
+++ b/resources/views/admin/modules.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?php use Fisharebest\Webtrees\Module\ModuleAnalyticsInterface; ?>
<?php use Fisharebest\Webtrees\Module\ModuleBlockInterface; ?>
@@ -37,7 +36,12 @@
<form method="post">
<input type="hidden" name="route" value="admin-update-module-status">
<?= csrf_field() ?>
- <table class="table table-bordered table-hover table-sm table-module-administration" data-info="false" data-paging="false" data-state-save="true" data-filter="false">
+ <table class="table table-bordered table-hover table-sm table-module-administration"
+ <?= view('lists/datatables-attributes') ?>
+ data-info="false"
+ data-paging="false"
+ data-filter="false"
+ >
<caption class="sr-only">
<?= I18N::translate('Module administration') ?>
</caption>
@@ -114,7 +118,7 @@
<?= $module->title() ?>
</th>
<td class="text-center" data-sort="<?= $module->isEnabled() ?>">
- <?= Bootstrap4::checkbox('', false, ['name' => 'status-' . $module->name(), 'checked' => $module->isEnabled()]) ?>
+ <?= view('components/checkbox', ['label' => '', 'name' => 'status-' . $module->name(), 'checked' => $module->isEnabled()]) ?>
</td>
<td>
<?= $module->description() ?>
@@ -263,6 +267,6 @@
<script>
'use strict';
- $(".table-module-administration").dataTable({<?= I18N::datatablesI18N() ?>});
+ $(".table-module-administration").dataTable();
</script>
<?php View::endpush() ?>
diff --git a/resources/views/admin/site-logs.phtml b/resources/views/admin/site-logs.phtml
index b9c74c3ee7..36e2bd6e4c 100644
--- a/resources/views/admin/site-logs.phtml
+++ b/resources/views/admin/site-logs.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?php use Fisharebest\Webtrees\View; ?>
@@ -29,7 +28,7 @@
<label for="type">
<?= I18N::translate('Type') ?>
</label>
- <?= Bootstrap4::select(['' => '', 'auth' => 'auth', 'config' => 'config', 'debug' => 'debug', 'edit' => 'edit', 'error' => 'error', 'media' => 'media', 'search' => 'search'], $type, ['id' => 'type', 'name' => 'type']) ?>
+ <?= view('components/select', ['name' => 'type', 'selected' => $type, 'values' => ['' => '', 'auth' => 'auth', 'config' => 'config', 'debug' => 'debug', 'edit' => 'edit', 'error' => 'error', 'media' => 'media', 'search' => 'search']]) ?>
</div>
<div class="form-group col-xs-6 col-sm-4">
@@ -52,14 +51,14 @@
<label for="username">
<?= I18N::translate('User') ?>
</label>
- <?= Bootstrap4::select($user_options, $username, ['id' => 'username', 'name' => 'username']) ?>
+ <?= view('components/select', ['name' => 'username', 'selected' => $username, 'values' => $user_options]) ?>
</div>
<div class="form-group col-sm-4">
<label for="gedc">
<?= I18N::translate('Family tree') ?>
</label>
- <?= Bootstrap4::select($tree_options, $gedc, ['id' => 'gedc', 'name' => 'gedc']) ?>
+ <?= view('components/select', ['name' => 'gedc', 'selected' => $gedc, 'values' => $tree_options]) ?>
</div>
</div>
@@ -82,7 +81,11 @@
</form>
<?php if ($action) : ?>
- <table class="table table-bordered table-sm table-hover table-site-logs" data-ajax="<?= e(route('admin-site-logs-data', ['from' => $from, 'to' => $to, 'type' => $type, 'text' => $text, 'ip' => $ip, 'user' => $username, 'gedc' => $gedc])) ?>" data-server-side="true">
+ <table class="table table-bordered table-sm table-hover table-site-logs"
+ <?= view('lists/datatables-attributes') ?>
+ data-ajax="<?= e(route('admin-site-logs-data', ['from' => $from, 'to' => $to, 'type' => $type, 'text' => $text, 'ip' => $ip, 'user' => $username, 'gedc' => $gedc])) ?>"
+ data-server-side="true"
+ >
<thead>
<tr>
<th></th>
@@ -123,8 +126,7 @@
/* IP address */ { },
/* User */ { },
/* Family tree */ { }
- ],
- <?= I18N::datatablesI18N([10, 20, 50, 100, 500, 1000, -1]) ?>
+ ]
});
</script>
<?php View::endpush() ?>
diff --git a/resources/views/admin/site-mail.phtml b/resources/views/admin/site-mail.phtml
index 8a8d46803b..d3692f2c11 100644
--- a/resources/views/admin/site-mail.phtml
+++ b/resources/views/admin/site-mail.phtml
@@ -1,5 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?php use Fisharebest\Webtrees\Site; ?>
<?php use Fisharebest\Webtrees\View; ?>
@@ -21,7 +19,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Messages') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($mail_transport_options, Site::getPreference('SMTP_ACTIVE'), ['id' => 'SMTP_ACTIVE', 'name' => 'SMTP_ACTIVE']) ?>
+ <?= view('components/select', ['name' => 'SMTP_ACTIVE', 'selected' => Site::getPreference('SMTP_ACTIVE'), 'values' => $mail_transport_options]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Messages” site configuration setting */ I18N::translate('webtrees needs to send emails, such as password reminders and website notifications. To do this, it can use this server’s built in PHP mail facility (which is not always available) or an external SMTP (mail-relay) service, for which you will need to provide the connection details.') ?>
</p>
@@ -76,7 +74,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Use password') ?>
</legend>
<div class="col-sm-9">
- <?= Bootstrap4::radioButtons('SMTP_AUTH', FunctionsEdit::optionsNoYes(), Site::getPreference('SMTP_AUTH'), true) ?>
+ <?= view('components/radios-inline', ['name' => 'SMTP_AUTH', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) Site::getPreference('SMTP_AUTH')]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Use password” site configuration setting */ I18N::translate('Most SMTP servers require a password.') ?>
</p>
@@ -116,7 +114,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Secure connection') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($mail_ssl_options, Site::getPreference('SMTP_SSL'), ['id' => 'SMTP_SSL', 'name' => 'SMTP_SSL']) ?>
+ <?= view('components/select', ['name' => 'SMTP_SSL', 'selected' => Site::getPreference('SMTP_SSL'), 'values' => $mail_ssl_options]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Secure connection” site configuration setting */ I18N::translate('Most servers do not use secure connections.') ?>
</p>
diff --git a/resources/views/admin/site-preferences.phtml b/resources/views/admin/site-preferences.phtml
index eab5587d43..ccec2c83e7 100644
--- a/resources/views/admin/site-preferences.phtml
+++ b/resources/views/admin/site-preferences.phtml
@@ -1,5 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?php use Fisharebest\Webtrees\Site; ?>
@@ -41,7 +39,7 @@
<?= I18N::translate('Time zone') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select(array_combine(\DateTimeZone::listIdentifiers(), \DateTimeZone::listIdentifiers()), Site::getPreference('TIMEZONE') ?: 'UTC', ['id' => 'TIMEZONE', 'name' => 'TIMEZONE']) ?>
+ <?= view('components/select', ['name' => 'TIMEZONE', 'selected' => Site::getPreference('TIMEZONE', 'UTC'), 'values' => array_combine(\DateTimeZone::listIdentifiers(), \DateTimeZone::listIdentifiers())]) ?>
<p class="small text-muted">
<?= I18N::translate('The time zone is required for date calculations, such as knowing today’s date.') ?>
</p>
@@ -55,7 +53,7 @@
I18N::translate('Default theme') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($all_themes, Site::getPreference('THEME_DIR', 'webtrees'), ['id' => 'THEME_DIR', 'name' => 'THEME_DIR']) ?>
+ <?= view('components/select', ['name' => 'THEME_DIR', 'selected' => Site::getPreference('THEME_DIR', 'webtrees'), 'values' => $all_themes]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the "Default theme" site configuration setting */
I18N::translate('You can change the appearance of webtrees using “themes”. Each theme has a different style, layout, color scheme, etc.') ?>
@@ -74,7 +72,7 @@
I18N::translate('Show list of family trees') ?>
</legend>
<div class="col-sm-9">
- <?= Bootstrap4::radioButtons('ALLOW_CHANGE_GEDCOM', FunctionsEdit::optionsNoYes(), (string) (int) Site::getPreference('ALLOW_CHANGE_GEDCOM'), true) ?>
+ <?= view('components/radios-inline', ['name' => 'ALLOW_CHANGE_GEDCOM', 'values' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) Site::getPreference('ALLOW_CHANGE_GEDCOM')]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Show list of family trees” site configuration setting */
I18N::translate('For websites with more than one family tree, this option will show the list of family trees in the main menu, the search pages, etc.') ?>
diff --git a/resources/views/admin/site-registration.phtml b/resources/views/admin/site-registration.phtml
index 72fe596fe9..16e08fd6af 100644
--- a/resources/views/admin/site-registration.phtml
+++ b/resources/views/admin/site-registration.phtml
@@ -1,5 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?php use Fisharebest\Webtrees\Site; ?>
@@ -16,7 +14,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Welcome text on sign-in page') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($registration_text_options, Site::getPreference('WELCOME_TEXT_AUTH_MODE'), ['id' => 'WELCOME_TEXT_AUTH_MODE', 'name' => 'WELCOME_TEXT_AUTH_MODE']) ?>
+ <?= view('components/select', ['name' => 'WELCOME_TEXT_AUTH_MODE', 'selected' => Site::getPreference('WELCOME_TEXT_AUTH_MODE'), 'values' => $registration_text_options]) ?>
<p class="small text-muted">
</p>
</div>
@@ -42,7 +40,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Allow visitors to request a new user account') ?>
</legend>
<div class="col-sm-9">
- <?= Bootstrap4::radioButtons('USE_REGISTRATION_MODULE', FunctionsEdit::optionsNoYes(), (string) (int) Site::getPreference('USE_REGISTRATION_MODULE'), true) ?>
+ <?= view('components/radios-inline', ['name' => 'USE_REGISTRATION_MODULE', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) Site::getPreference('USE_REGISTRATION_MODULE')]) ?>
<p class="small text-muted">
<?= I18N::translate('The new user will be asked to confirm their email address before the account is created.') ?>
<?= I18N::translate('Details of the new user will be sent to the genealogy contact for the corresponding family tree.') ?>
@@ -59,7 +57,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Show acceptable use agreement on “Request a new user account” page') ?>
</legend>
<div class="col-sm-9">
- <?= Bootstrap4::radioButtons('SHOW_REGISTER_CAUTION', FunctionsEdit::optionsNoYes(), (string) (int) Site::getPreference('SHOW_REGISTER_CAUTION'), true) ?>
+ <?= view('components/radios-inline', ['name' => 'SHOW_REGISTER_CAUTION', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) Site::getPreference('SHOW_REGISTER_CAUTION')]) ?>
<p class="small text-muted">
</p>
</div>
diff --git a/resources/views/admin/trees-merge.phtml b/resources/views/admin/trees-merge.phtml
index 7b792d7666..362076cf13 100644
--- a/resources/views/admin/trees-merge.phtml
+++ b/resources/views/admin/trees-merge.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('admin-trees', ['ged' => $tree->name()]) => I18N::translate('Manage family trees '), $title]]) ?>
@@ -32,8 +31,8 @@
<p class="form-inline">
<?= I18N::translate(/* I18N: Copy all the records from [family tree 1] into [family tree 2] */
'Copy all the records from %1$s into %2$s.',
- Bootstrap4::select($tree_list, $tree1 ? $tree1->name() : '', ['name' => 'tree1_name']),
- Bootstrap4::select($tree_list, $tree2 ? $tree2->name() : '', ['name' => 'tree2_name'])
+ view('components/select', ['name' => 'tree1_name', 'selected' => $tree1 ? $tree1->name() : '', 'values' => $tree_list]),
+ view('components/select', ['name' => 'tree2_name', 'selected' => $tree2 ? $tree2->name() : '', 'values' => $tree_list])
) ?>
</p>
diff --git a/resources/views/admin/trees-preferences.phtml b/resources/views/admin/trees-preferences.phtml
index 0eeed5f7c6..14fec13d61 100644
--- a/resources/views/admin/trees-preferences.phtml
+++ b/resources/views/admin/trees-preferences.phtml
@@ -1,6 +1,9 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
-<?php use Fisharebest\Webtrees\I18N; ?>
+<?php
+
+use Fisharebest\Webtrees\Functions\FunctionsEdit;
+use Fisharebest\Webtrees\I18N;
+
+?>
<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('admin-trees') => I18N::translate('Manage family trees'), $title]]) ?>
@@ -78,7 +81,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Default individual') ?>
</label>
<div class="col-sm-9">
- <?= FunctionsEdit::formControlIndividual($tree, $pedigree_individual, ['id' => 'PEDIGREE_ROOT_ID', 'name' => 'PEDIGREE_ROOT_ID']) ?>
+ <?= view('components/select-individual', ['name' => 'PEDIGREE_ROOT_ID', 'individual' => $pedigree_individual, 'tree' => $tree]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Default individual” configuration setting */ I18N::translate('This individual will be selected by default when viewing charts and reports.') ?>
</p>
@@ -98,12 +101,12 @@
</label>
</legend>
<div class="col-sm-9">
- <div class=row">
+ <div class="row">
<div class="col-sm-6" style="padding-left: 0;">
- <?= Bootstrap4::select(FunctionsEdit::optionsCalendarConversions(), $calendar_formats[0], ['name' => 'CALENDAR_FORMAT0']) ?>
+ <?= view('components/select', ['name' => 'CALENDAR_FORMAT0', 'selected' => $calendar_formats[0], 'values' => FunctionsEdit::optionsCalendarConversions()]) ?>
</div>
<div class="col-sm-6" style="padding-right: 0;">
- <?= Bootstrap4::select(FunctionsEdit::optionsCalendarConversions(), $calendar_formats[1], ['name' => 'CALENDAR_FORMAT1']) ?>
+ <?= view('components/select', ['name' => 'CALENDAR_FORMAT1', 'selected' => $calendar_formats[1], 'values' => FunctionsEdit::optionsCalendarConversions()]) ?>
</div>
</div>
<p class="small text-muted">
@@ -126,7 +129,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Add unique identifiers') ?>
</legend>
<div class="col-sm-9">
- <?= view('components/radios-no-yes', ['name' => 'GENERATE_UIDS', 'value' => $tree->getPreference('GENERATE_UIDS')]) ?>
+ <?= view('components/radios-inline', ['name' => 'GENERATE_UIDS', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $tree->getPreference('GENERATE_UIDS')]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Add unique identifiers” configuration setting */ I18N::translate('Unique identifiers allow the same record to be found in different family trees and in different systems. They will be added whenever records are created or updated. If you do not want unique identifiers to be displayed, you can hide them using the privacy rules.') ?>
</p>
@@ -247,7 +250,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Theme menu') ?>
</legend>
<div class="col-sm-9">
- <?= view('components/radios-hide-show', ['name' => 'ALLOW_THEME_DROPDOWN', 'value' => $tree->getPreference('ALLOW_THEME_DROPDOWN')]) ?>
+ <?= view('components/radios-inline', ['name' => 'ALLOW_THEME_DROPDOWN', 'options' => [I18N::translate('hide'), I18N::translate('show')], 'selected' => (int) $tree->getPreference('ALLOW_THEME_DROPDOWN')]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Theme dropdown selector for theme changes” configuration setting */ I18N::translate('The theme menu will only be shown if the website preferences allow users to select their own theme.') ?>
</p>
@@ -261,7 +264,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Default theme') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($theme_options, $tree->getPreference('THEME_DIR'), ['id' => 'THEME_DIR', 'name' => 'THEME_DIR']) ?>
+ <?= view('components/select', ['name' => 'THEME_DIR', 'selected' => $tree->getPreference('THEME_DIR'), 'values' => $theme_options]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Default theme” configuration setting */ I18N::translate('You can change the appearance of webtrees using “themes”. Each theme has a different style, layout, color scheme, etc.') ?>
</p>
@@ -300,7 +303,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Who can upload new media files') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($privacy_options, $tree->getPreference('MEDIA_UPLOAD'), ['id' => 'MEDIA_UPLOAD', 'name' => 'MEDIA_UPLOAD']) ?>
+ <?= view('components/select', ['name' => 'MEDIA_UPLOAD', 'selected' => $tree->getPreference('MEDIA_UPLOAD'), 'values' => $privacy_options]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Who can upload new media files” configuration setting */ I18N::translate('If you are concerned that users might upload inappropriate images, you can restrict media uploads to managers only.') ?>
</p>
@@ -314,7 +317,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Show a download link in the media viewer') ?>
</legend>
<div class="col-sm-9">
- <?= Bootstrap4::select(FunctionsEdit::optionsAccessLevels(), $tree->getPreference('SHOW_MEDIA_DOWNLOAD'), ['id' => 'SHOW_MEDIA_DOWNLOAD', 'name' => 'SHOW_MEDIA_DOWNLOAD']) ?>
+ <?= view('components/select', ['name' => 'SHOW_MEDIA_DOWNLOAD', 'selected' => $tree->getPreference('SHOW_MEDIA_DOWNLOAD'), 'values' => FunctionsEdit::optionsAccessLevels()]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Show a download link in the media viewer” configuration setting */ I18N::translate('This option will make it easier for users to download images.') ?>
</p>
@@ -331,7 +334,7 @@
<?= I18N::translate('Thumbnail images') ?>
</legend>
<div class="col-sm-9">
- <?= view('components/radios-hide-show', ['name' => 'SHOW_HIGHLIGHT_IMAGES', 'value' => $tree->getPreference('SHOW_HIGHLIGHT_IMAGES')]) ?>
+ <?= view('components/radios-inline', ['name' => 'SHOW_HIGHLIGHT_IMAGES', 'options' => [I18N::translate('hide'), I18N::translate('show')], 'selected' => (int) $tree->getPreference('SHOW_HIGHLIGHT_IMAGES')]) ?>
<p class="small text-muted">
<?= I18N::translate('Show thumbnail images in charts and family groups.') ?>
</p>
@@ -346,7 +349,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Use silhouettes') ?>
</legend>
<div class="col-sm-9">
- <?= view('components/radios-no-yes', ['name' => 'USE_SILHOUETTE', 'value' => $tree->getPreference('USE_SILHOUETTE')]) ?>
+ <?= view('components/radios-inline', ['name' => 'USE_SILHOUETTE', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $tree->getPreference('USE_SILHOUETTE')]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Use silhouettes” configuration setting */ I18N::translate('Use silhouette images when no highlighted image for that individual has been specified. The images used are specific to the gender of the individual in question.') ?>
</p>
@@ -362,7 +365,7 @@
<?= I18N::translate('Images without watermarks') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select(FunctionsEdit::optionsAccessLevels(), $tree->getPreference('SHOW_NO_WATERMARK'), ['id' => 'SHOW_NO_WATERMARK', 'name' => 'SHOW_NO_WATERMARK']) ?>
+ <?= view('components/select', ['name' => 'SHOW_NO_WATERMARK', 'selected' => $tree->getPreference('SHOW_NO_WATERMARK'), 'values' => FunctionsEdit::optionsAccessLevels()]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Images without watermarks” configuration setting */ I18N::translate('Watermarks are optional and normally shown just to visitors.') ?>
</p>
@@ -377,7 +380,7 @@
<?= I18N::translate('Surname list style') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($surname_list_styles, $tree->getPreference('SURNAME_LIST_STYLE'), ['id' => 'SURNAME_LIST_STYLE', 'name' => 'SURNAME_LIST_STYLE']) ?>
+ <?= view('components/select', ['name' => 'SURNAME_LIST_STYLE', 'selected' => $tree->getPreference('SURNAME_LIST_STYLE'), 'values' => $surname_list_styles]) ?>
<p class="small text-muted">
</p>
</div>
@@ -411,7 +414,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Estimated dates for birth and death') ?>
</legend>
<div class="col-sm-9">
- <?= view('components/radios-hide-show', ['name' => 'SHOW_EST_LIST_DATES', 'value' => $tree->getPreference('SHOW_EST_LIST_DATES')]) ?>
+ <?= view('components/radios-inline', ['name' => 'SHOW_EST_LIST_DATES', 'options' => [I18N::translate('hide'), I18N::translate('show')], 'selected' => (int) $tree->getPreference('SHOW_EST_LIST_DATES')]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Estimated dates for birth and death” configuration setting */ I18N::translate('This option controls whether or not to show estimated dates for birth and death instead of leaving blanks on individual lists and charts for individuals whose dates are not known.') ?>
</p>
@@ -426,7 +429,7 @@
<?= I18N::translate('The date and time of the last update') ?>
</legend>
<div class="col-sm-9">
- <?= view('components/radios-hide-show', ['name' => 'SHOW_LAST_CHANGE', 'value' => $tree->getPreference('SHOW_LAST_CHANGE')]) ?>
+ <?= view('components/radios-inline', ['name' => 'SHOW_LAST_CHANGE', 'options' => [I18N::translate('hide'), I18N::translate('show')], 'selected' => (int) $tree->getPreference('SHOW_LAST_CHANGE')]) ?>
<p class="small text-muted">
</p>
</div>
@@ -442,7 +445,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Age of parents next to child’s birthdate') ?>
</legend>
<div class="col-sm-9">
- <?= view('components/radios-hide-show', ['name' => 'SHOW_PARENTS_AGE', 'value' => $tree->getPreference('SHOW_PARENTS_AGE')]) ?>
+ <?= view('components/radios-inline', ['name' => 'SHOW_PARENTS_AGE', 'options' => [I18N::translate('hide'), I18N::translate('show')], 'selected' => (int) $tree->getPreference('SHOW_PARENTS_AGE')]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Age of parents next to child’s birthdate” configuration setting */ I18N::translate('This option controls whether or not to show age of father and mother next to child’s birthdate on charts.') ?>
</p>
@@ -457,7 +460,7 @@
</label>
<div class="col-sm-9">
<div class="input-group">
- <?= Bootstrap4::multiSelect($all_indi_facts, explode(',', $tree->getPreference('CHART_BOX_TAGS')), ['id' => 'CHART_BOX_TAGS', 'name' => 'CHART_BOX_TAGS[]', 'class' => 'select2']) ?>
+ <?= view('components/select', ['name' => 'CHART_BOX_TAGS', 'selected' => explode(',', $tree->getPreference('CHART_BOX_TAGS')), 'values' => $all_indi_facts, 'class' => 'select2']) ?>
</div>
<p class="small text-muted">
<?= /* I18N: Help text for the “Other facts to show in charts” configuration setting */ I18N::translate('This should be a comma or space separated list of facts, in addition to birth and death, that you want to appear in chart boxes such as the pedigree chart. This list requires you to use fact tags as defined in the GEDCOM 5.5.1 standard. For example, if you wanted the occupation to show up in the box, you would add “OCCU” to this field.') ?>
@@ -567,7 +570,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Fact icons') ?>
</legend>
<div class="col-sm-9">
- <?= view('components/radios-hide-show', ['name' => 'SHOW_FACT_ICONS', 'value' => $tree->getPreference('SHOW_FACT_ICONS')]) ?>
+ <?= view('components/radios-inline', ['name' => 'SHOW_FACT_ICONS', 'options' => [I18N::translate('hide'), I18N::translate('show')], 'selected' => (int) $tree->getPreference('SHOW_FACT_ICONS')]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Fact icons” configuration setting */ I18N::translate('Some themes can display icons on the “Facts and events” tab.') ?>
</p>
@@ -582,7 +585,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Automatically expand notes') ?>
</legend>
<div class="col-sm-9">
- <?= view('components/radios-no-yes', ['name' => 'EXPAND_NOTES', 'value' => $tree->getPreference('EXPAND_NOTES')]) ?>
+ <?= view('components/radios-inline', ['name' => 'EXPAND_NOTES', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $tree->getPreference('EXPAND_NOTES')]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Automatically expand notes” configuration setting */
I18N::translate('This option controls whether or not to automatically display content of a <i>Note</i> record on the Individual page.') ?>
@@ -598,7 +601,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Automatically expand sources') ?>
</legend>
<div class="col-sm-9">
- <?= view('components/radios-no-yes', ['name' => 'EXPAND_SOURCES', 'value' => $tree->getPreference('EXPAND_SOURCES')]) ?>
+ <?= view('components/radios-inline', ['name' => 'EXPAND_SOURCES', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $tree->getPreference('EXPAND_SOURCES')]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Automatically expand sources” configuration setting */
I18N::translate('This option controls whether or not to automatically display content of a <i>Source</i> record on the Individual page.') ?>
@@ -623,13 +626,9 @@
</label>
</legend>
<div class="col-sm-9">
- <?= /* I18N: The placeholders are edit controls. Show the [first/last] [1/2/3/4/5] parts of a place name */ I18N::translate(
- 'Show the %1$s %2$s parts of a place name.',
- Bootstrap4::select([
- '0' => I18N::translateContext('Show the [first/last] [N] parts of a place name.', 'first'),
- '1' => I18N::translateContext('Show the [first/last] [N] parts of a place name.', 'last'),
- ], $tree->getPreference('SHOW_PEDIGREE_PLACES_SUFFIX'), ['name' => 'SHOW_PEDIGREE_PLACES_SUFFIX']),
- Bootstrap4::select(FunctionsEdit::numericOptions(range(1, 9)), $tree->getPreference('SHOW_PEDIGREE_PLACES'), ['name' => 'SHOW_PEDIGREE_PLACES'])
+ <?= /* I18N: The placeholders are edit controls. Show the [first/last] [1/2/3/4/5] parts of a place name */ I18N::translate('Show the %1$s %2$s parts of a place name.',
+ view('components/select', ['name' => 'SHOW_PEDIGREE_PLACES_SUFFIX', 'selected' => $tree->getPreference('SHOW_PEDIGREE_PLACES'), 'values' => ['0' => I18N::translateContext('Show the [first/last] [N] parts of a place name.', 'first'), '1' => I18N::translateContext('Show the [first/last] [N] parts of a place name.', 'last')]]),
+ view('components/select', ['name' => 'SHOW_PEDIGREE_PLACES', 'selected' => $tree->getPreference('SHOW_PEDIGREE_PLACES'), 'values' => FunctionsEdit::numericOptions(range(1, 9))])
) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Abbreviate place names” configuration setting */ I18N::translate('Place names are frequently too long to fit on charts, lists, etc. They can be abbreviated by showing just the first few parts of the name, such as <i>village, county</i>, or the last few part of it, such as <i>region, country</i>.') ?>
@@ -668,7 +667,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Format text and notes') ?>
</legend>
<div class="col-sm-9">
- <?= Bootstrap4::radioButtons('FORMAT_TEXT', $formats, $tree->getPreference('FORMAT_TEXT'), true) ?>
+ <?= view('components/radios-inline', ['name' => 'FORMAT_TEXT', 'options' => $formats, 'selected' => (bool) $tree->getPreference('FORMAT_TEXT')]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Format text and notes” configuration setting */ I18N::translate('To ensure compatibility with other genealogy applications, notes, text, and transcripts should be recorded in simple, unformatted text. However, formatting is often desirable to aid presentation, comprehension, etc.') ?>
</p>
@@ -688,7 +687,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Allow users to see raw GEDCOM records') ?>
</legend>
<div class="col-sm-9">
- <?= view('components/radios-no-yes', ['name' => 'SHOW_GEDCOM_RECORD', 'value' => $tree->getPreference('SHOW_GEDCOM_RECORD')]) ?>
+ <?= view('components/radios-inline', ['name' => 'SHOW_GEDCOM_RECORD', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $tree->getPreference('SHOW_GEDCOM_RECORD')]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Allow users to see raw GEDCOM records” configuration setting */ I18N::translate('Setting this to <b>Yes</b> will place links on individuals, sources, and families to let users bring up another window containing the raw data taken right out of the GEDCOM file.') ?>
</p>
@@ -703,7 +702,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('GEDCOM errors') ?>
</legend>
<div class="col-sm-9">
- <?= view('components/radios-hide-show', ['name' => 'HIDE_GEDCOM_ERRORS', 'value' => $tree->getPreference('HIDE_GEDCOM_ERRORS')]) ?>
+ <?= view('components/radios-inline', ['name' => 'HIDE_GEDCOM_ERRORS', 'options' => [I18N::translate('hide'), I18N::translate('show')], 'selected' => (int) $tree->getPreference('HIDE_GEDCOM_ERRORS')]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “GEDCOM errors” configuration setting */ I18N::translate('Many genealogy programs create GEDCOM files with custom tags, and webtrees understands most of them. When unrecognized tags are found, this option lets you choose whether to ignore them or display a warning message.') ?>
</p>
@@ -718,7 +717,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Hit counters') ?>
</legend>
<div class="col-sm-9">
- <?= view('components/radios-hide-show', ['name' => 'SHOW_COUNTER', 'value' => $tree->getPreference('SHOW_COUNTER')]) ?>
+ <?= view('components/radios-inline', ['name' => 'SHOW_COUNTER', 'options' => [I18N::translate('hide'), I18N::translate('show')], 'selected' => (int) $tree->getPreference('SHOW_COUNTER')]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Hit counters” configuration setting */ I18N::translate('Some pages can display the number of times that they have been visited.') ?>
</p>
@@ -736,7 +735,7 @@
<?= I18N::translate('All individual facts') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::multiSelect($all_indi_facts, explode(',', $tree->getPreference('INDI_FACTS_ADD')), ['id' => 'INDI_FACTS_ADD', 'name' => 'INDI_FACTS_ADD[]', 'class' => 'select2']) ?>
+ <?= view('components/select', ['name' => 'INDI_FACTS_ADD', 'selected' => explode(',', $tree->getPreference('INDI_FACTS_ADD')), 'values' => $all_indi_facts, 'class' => 'select2']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “All individual facts” configuration setting */ I18N::translate('This is the list of GEDCOM facts that your users can add to individuals. You can modify this list by removing or adding fact names, even custom ones, as necessary. Fact names that appear in this list must not also appear in the “Unique individual facts” list.') ?>
</p>
@@ -749,7 +748,7 @@
<?= I18N::translate('Unique individual facts') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::multiSelect($all_indi_facts, explode(',', $tree->getPreference('INDI_FACTS_UNIQUE')), ['id' => 'INDI_FACTS_UNIQUE', 'name' => 'INDI_FACTS_UNIQUE[]', 'class' => 'select2']) ?>
+ <?= view('components/select', ['name' => 'INDI_FACTS_UNIQUE', 'selected' => explode(',', $tree->getPreference('INDI_FACTS_UNIQUE')), 'values' => $all_indi_facts, 'class' => 'select2']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Unique individual facts” configuration setting */ I18N::translate('This is the list of GEDCOM facts that your users can only add once to individuals. For example, if BIRT is in this list, users will not be able to add more than one BIRT record to an individual. Fact names that appear in this list must not also appear in the “All individual facts” list.') ?>
</p>
@@ -762,7 +761,7 @@
<?= I18N::translate('Facts for new individuals') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::multiSelect($all_indi_facts, explode(',', $tree->getPreference('QUICK_REQUIRED_FACTS')), ['id' => 'QUICK_REQUIRED_FACTS', 'name' => 'QUICK_REQUIRED_FACTS[]', 'class' => 'select2']) ?>
+ <?= view('components/select', ['name' => 'QUICK_REQUIRED_FACTS', 'selected' => explode(',', $tree->getPreference('QUICK_REQUIRED_FACTS')), 'values' => $all_indi_facts, 'class' => 'select2']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Facts for new individuals” configuration setting */ I18N::translate('This is a comma separated list of GEDCOM fact tags that will be shown when adding a new individual. For example, if BIRT is in the list, fields for birth date and birth place will be shown on the form.') ?>
</p>
@@ -775,7 +774,7 @@
<?= I18N::translate('Quick individual facts') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::multiSelect($all_indi_facts, explode(',', $tree->getPreference('INDI_FACTS_QUICK')), ['id' => 'INDI_FACTS_QUICK', 'name' => 'INDI_FACTS_QUICK[]', 'class' => 'select2']) ?>
+ <?= view('components/select', ['name' => 'INDI_FACTS_QUICK', 'selected' => explode(',', $tree->getPreference('INDI_FACTS_QUICK')), 'values' => $all_fam_facts, 'class' => 'select2']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Quick individual facts” configuration setting */ I18N::translate('The most common individual facts and events are listed separately, so that they can be added more easily.') ?>
</p>
@@ -790,7 +789,7 @@
<?= I18N::translate('All family facts') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::multiSelect($all_fam_facts, explode(',', $tree->getPreference('FAM_FACTS_ADD')), ['id' => 'FAM_FACTS_ADD', 'name' => 'FAM_FACTS_ADD[]', 'class' => 'select2']) ?>
+ <?= view('components/select', ['name' => 'FAM_FACTS_ADD', 'selected' => explode(',', $tree->getPreference('FAM_FACTS_ADD')), 'values' => $all_fam_facts, 'class' => 'select2']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “All family facts” configuration setting */ I18N::translate('This is the list of GEDCOM facts that your users can add to families. You can modify this list by removing or adding fact names, even custom ones, as necessary. Fact names that appear in this list must not also appear in the “Unique family facts” list.') ?>
</p>
@@ -803,7 +802,7 @@
<?= I18N::translate('Unique family facts') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::multiSelect($all_fam_facts, explode(',', $tree->getPreference('FAM_FACTS_UNIQUE')), ['id' => 'FAM_FACTS_UNIQUE', 'name' => 'FAM_FACTS_UNIQUE[]', 'class' => 'select2']) ?>
+ <?= view('components/select', ['name' => 'FAM_FACTS_UNIQUE', 'selected' => explode(',', $tree->getPreference('FAM_FACTS_UNIQUE')), 'values' => $all_fam_facts, 'class' => 'select2']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Unique family facts” configuration setting */ I18N::translate('This is the list of GEDCOM facts that your users can only add once to families. For example, if MARR is in this list, users will not be able to add more than one MARR record to a family. Fact names that appear in this list must not also appear in the “All family facts” list.') ?>
</p>
@@ -816,7 +815,7 @@
<?= I18N::translate('Facts for new families') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::multiSelect($all_fam_facts, explode(',', $tree->getPreference('QUICK_REQUIRED_FAMFACTS')), ['id' => 'QUICK_REQUIRED_FAMFACTS', 'name' => 'QUICK_REQUIRED_FAMFACTS[]', 'class' => 'select2']) ?>
+ <?= view('components/select', ['name' => 'QUICK_REQUIRED_FAMFACTS', 'selected' => explode(',', $tree->getPreference('QUICK_REQUIRED_FAMFACTS')), 'values' => $all_fam_facts, 'class' => 'select2']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Facts for new families” configuration setting */ I18N::translate('This is a comma separated list of GEDCOM fact tags that will be shown when adding a new family. For example, if MARR is in the list, then fields for marriage date and marriage place will be shown on the form.') ?>
</p>
@@ -829,7 +828,7 @@
<?= I18N::translate('Quick family facts') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::multiSelect($all_fam_facts, explode(',', $tree->getPreference('FAM_FACTS_QUICK')), ['id' => 'FAM_FACTS_QUICK', 'name' => 'FAM_FACTS_QUICK[]', 'class' => 'select2']) ?>
+ <?= view('components/select', ['name' => 'FAM_FACTS_QUICK', 'selected' => explode(',', $tree->getPreference('FAM_FACTS_QUICK')), 'values' => $all_fam_facts, 'class' => 'select2']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Quick family facts” configuration setting */ I18N::translate('The most common family facts and events are listed separately, so that they can be added more easily.') ?>
</p>
@@ -844,7 +843,7 @@
<?= I18N::translate('All source facts') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::multiSelect($all_sour_facts, explode(',', $tree->getPreference('SOUR_FACTS_ADD')), ['id' => 'SOUR_FACTS_ADD', 'name' => 'SOUR_FACTS_ADD[]', 'class' => 'select2']) ?>
+ <?= view('components/select', ['name' => 'SOUR_FACTS_ADD', 'selected' => explode(',', $tree->getPreference('SOUR_FACTS_ADD')), 'values' => $all_sour_facts, 'class' => 'select2']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “All source facts” configuration setting */ I18N::translate('This is the list of GEDCOM facts that your users can add to sources. You can modify this list by removing or adding fact names, even custom ones, as necessary. Fact names that appear in this list must not also appear in the “Unique source facts” list.') ?>
</p>
@@ -857,7 +856,7 @@
<?= I18N::translate('Unique source facts') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::multiSelect($all_sour_facts, explode(',', $tree->getPreference('SOUR_FACTS_UNIQUE')), ['id' => 'SOUR_FACTS_UNIQUE', 'name' => 'SOUR_FACTS_UNIQUE[]', 'class' => 'select2']) ?>
+ <?= view('components/select', ['name' => 'SOUR_FACTS_UNIQUE', 'selected' => explode(',', $tree->getPreference('SOUR_FACTS_UNIQUE')), 'values' => $all_sour_facts, 'class' => 'select2']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Unique source facts” configuration setting */ I18N::translate('This is the list of GEDCOM facts that your users can only add once to sources. For example, if TITL is in this list, users will not be able to add more than one TITL record to a source. Fact names that appear in this list must not also appear in the “All source facts” list.') ?>
</p>
@@ -870,7 +869,7 @@
<?= I18N::translate('Quick source facts') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::multiSelect($all_sour_facts, explode(',', $tree->getPreference('SOUR_FACTS_QUICK')), ['id' => 'SOUR_FACTS_QUICK', 'name' => 'SOUR_FACTS_QUICK[]', 'class' => 'select2']) ?>
+ <?= view('components/select', ['name' => 'SOUR_FACTS_QUICK', 'selected' => explode(',', $tree->getPreference('SOUR_FACTS_QUICK')), 'values' => $all_sour_facts, 'class' => 'select2']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Quick source facts” configuration setting */ I18N::translate('The most common source facts are listed separately, so that they can be added more easily.') ?>
</p>
@@ -885,7 +884,7 @@
<?= I18N::translate('All repository facts') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::multiSelect($all_repo_facts, explode(',', $tree->getPreference('REPO_FACTS_ADD')), ['id' => 'REPO_FACTS_ADD', 'name' => 'REPO_FACTS_ADD[]', 'class' => 'select2']) ?>
+ <?= view('components/select', ['name' => 'REPO_FACTS_ADD', 'selected' => explode(',', $tree->getPreference('REPO_FACTS_ADD')), 'values' => $all_repo_facts, 'class' => 'select2']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “All repository facts” configuration setting */ I18N::translate('This is the list of GEDCOM facts that your users can add to repositories. You can modify this list by removing or adding fact names, even custom ones, as necessary. Fact names that appear in this list must not also appear in the “Unique repository facts” list.') ?>
</p>
@@ -898,7 +897,7 @@
<?= I18N::translate('Unique repository facts') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::multiSelect($all_repo_facts, explode(',', $tree->getPreference('REPO_FACTS_UNIQUE')), ['id' => 'REPO_FACTS_UNIQUE', 'name' => 'REPO_FACTS_UNIQUE[]', 'class' => 'select2']) ?>
+ <?= view('components/select', ['name' => 'REPO_FACTS_UNIQUE', 'selected' => explode(',', $tree->getPreference('REPO_FACTS_UNIQUE')), 'values' => $all_repo_facts, 'class' => 'select2']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Unique repository facts” configuration setting */ I18N::translate('This is the list of GEDCOM facts that your users can only add once to repositories. For example, if NAME is in this list, users will not be able to add more than one NAME record to a repository. Fact names that appear in this list must not also appear in the “All repository facts” list.') ?>
</p>
@@ -911,7 +910,7 @@
<?= I18N::translate('Quick repository facts') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::multiSelect($all_repo_facts, explode(',', $tree->getPreference('REPO_FACTS_QUICK')), ['id' => 'REPO_FACTS_QUICK', 'name' => 'REPO_FACTS_QUICK[]', 'class' => 'select2']) ?>
+ <?= view('components/select', ['name' => 'REPO_FACTS_QUICK', 'selected' => explode(',', $tree->getPreference('REPO_FACTS_QUICK')), 'values' => $all_repo_facts, 'class' => 'select2']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Quick repository facts” configuration setting */ I18N::translate('The most common repository facts are listed separately, so that they can be added more easily.') ?>
</p>
@@ -926,7 +925,7 @@
<?= I18N::translate('Advanced name facts') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::multiSelect($all_name_facts, explode(',', $tree->getPreference('ADVANCED_NAME_FACTS')), ['id' => 'ADVANCED_NAME_FACTS', 'name' => 'ADVANCED_NAME_FACTS[]', 'class' => 'select2']) ?>
+ <?= view('components/select', ['name' => 'ADVANCED_NAME_FACTS', 'selected' => explode(',', $tree->getPreference('ADVANCED_NAME_FACTS')), 'values' => $all_name_facts, 'class' => 'select2']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Advanced name facts” configuration setting */ I18N::translate('This is a comma separated list of GEDCOM fact tags that will be shown on the add/edit name form. If you use non-Latin alphabets such as Hebrew, Greek, Cyrillic, or Arabic, you may want to add tags such as _HEB, ROMN, FONE, etc. to allow you to store names in several different alphabets.') ?>
</p>
@@ -939,7 +938,7 @@
<?= I18N::translate('Advanced place name facts') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::multiSelect($all_plac_facts, explode(',', $tree->getPreference('ADVANCED_PLAC_FACTS')), ['id' => 'ADVANCED_PLAC_FACTS', 'name' => 'ADVANCED_PLAC_FACTS[]', 'class' => 'select2']) ?>
+ <?= view('components/select', ['name' => 'ADVANCED_PLAC_FACTS', 'selected' => explode(',', $tree->getPreference('ADVANCED_PLAC_FACTS')), 'values' => $all_plac_facts, 'class' => 'select2']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Advanced place name facts” configuration setting */ I18N::translate('This is a comma separated list of GEDCOM fact tags that will be shown when you add or edit place names. If you use non-Latin alphabets such as Hebrew, Greek, Cyrillic, or Arabic, you may want to add tags such as _HEB, ROMN, FONE, etc. to allow you to store place names in several different alphabets.') ?>
</p>
@@ -955,7 +954,7 @@
<?= I18N::translate('Surname tradition') ?>
</legend>
<div class="col-sm-9">
- <?= Bootstrap4::radioButtons('SURNAME_TRADITION', $all_surname_traditions, $tree->getPreference('SURNAME_TRADITION'), false) ?>
+ <?= view('components/radios', ['name' => 'SURNAME_TRADITION', 'options' => $all_surname_traditions, 'selected' => $tree->getPreference('SURNAME_TRADITION')]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Surname tradition” configuration setting */ I18N::translate('When you add a new family member, a default surname can be provided. This surname will depend on the local tradition.') ?>
</p>
@@ -970,7 +969,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Use full source citations') ?>
</legend>
<div class="col-sm-9">
- <?= view('components/radios-no-yes', ['name' => 'FULL_SOURCES', 'value' => $tree->getPreference('FULL_SOURCES')]) ?>
+ <?= view('components/radios-inline', ['name' => 'FULL_SOURCES', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $tree->getPreference('FULL_SOURCES')]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Use full source citations” configuration setting */ I18N::translate('Source citations can include fields to record the quality of the data (primary, secondary, etc.) and the date the event was recorded in the source. If you don’t use these fields, you can disable them when creating new source citations.') ?>
</p>
@@ -985,7 +984,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Source type') ?>
</legend>
<div class="col-sm-9">
- <?= Bootstrap4::radioButtons('PREFER_LEVEL2_SOURCES', $source_types, $tree->getPreference('PREFER_LEVEL2_SOURCES'), true) ?>
+ <?= view('components/radios-inline', ['name' => 'PREFER_LEVEL2_SOURCES', 'options' => $source_types, 'selected' => $tree->getPreference('PREFER_LEVEL2_SOURCES')]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Source type” configuration setting */ I18N::translate('When adding new close relatives, you can add source citations to the records (individual and family) or to the facts and events (birth, marriage, and death). This option controls whether records or facts will be selected by default.') ?>
</p>
@@ -1000,7 +999,7 @@
<?= /* I18N: A configuration setting */ I18N::translate('Keep the existing “last change” information') ?>
</legend>
<div class="col-sm-9">
- <?= view('components/radios-no-yes', ['name' => 'NO_UPDATE_CHAN', 'value' => $tree->getPreference('NO_UPDATE_CHAN')]) ?>
+ <?= view('components/radios-inline', ['name' => 'NO_UPDATE_CHAN', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $tree->getPreference('NO_UPDATE_CHAN')]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Keep the existing ‘last change’ information” configuration setting */ I18N::translate('When a record is edited, the user and timestamp are recorded. Sometimes it is desirable to keep the existing “last change” information, for example when making minor corrections to someone else’s data. This option controls whether this feature is selected by default.') ?>
</p>
diff --git a/resources/views/admin/trees-privacy.phtml b/resources/views/admin/trees-privacy.phtml
index 9490a4a284..3de02bf123 100644
--- a/resources/views/admin/trees-privacy.phtml
+++ b/resources/views/admin/trees-privacy.phtml
@@ -1,12 +1,12 @@
-<?php use Fisharebest\Webtrees\Bootstrap4;
+<?php
+
use Fisharebest\Webtrees\Functions\FunctionsEdit;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Site;
-use Fisharebest\Webtrees\View; ?>
-<?php ?>
-<?php ?>
-<?php ?>
-<?php ?>
+use Fisharebest\Webtrees\View;
+use Ramsey\Uuid\Uuid;
+
+?>
<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('admin-trees') => I18N::translate('Manage family trees'), $title]]) ?>
@@ -29,7 +29,7 @@ use Fisharebest\Webtrees\View; ?>
</div>
</div>
<div class="col-sm-8">
- <?= Bootstrap4::select(['0' => I18N::translate('Show to visitors'), '1' => I18N::translate('Show to members')], $tree->getPreference('REQUIRE_AUTHENTICATION'), ['id' => 'REQUIRE_AUTHENTICATION', 'name' => 'REQUIRE_AUTHENTICATION']) ?>
+ <?= view('components/select', ['name' => 'REQUIRE_AUTHENTICATION', 'selected' => $tree->getPreference('REQUIRE_AUTHENTICATION'), 'values' => ['0' => I18N::translate('Show to visitors'), '1' => I18N::translate('Show to members')]]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Family tree” configuration setting */ I18N::translate('Enabling this option will force all visitors to sign in before they can view any data on the website.') ?>
</p>
@@ -53,7 +53,7 @@ use Fisharebest\Webtrees\View; ?>
</div>
</div>
<div class="col-sm-8">
- <?= Bootstrap4::select(array_slice(FunctionsEdit::optionsAccessLevels(), 0, 2, true), $tree->getPreference('SHOW_DEAD_PEOPLE'), ['id' => 'SHOW_DEAD_PEOPLE', 'name' => 'SHOW_DEAD_PEOPLE']) ?>
+ <?= view('components/select', ['name' => 'SHOW_DEAD_PEOPLE', 'selected' => $tree->getPreference('SHOW_DEAD_PEOPLE'), 'values' => array_slice(FunctionsEdit::optionsAccessLevels(), 0, 2, true)]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Show dead individuals” configuration setting */ I18N::translate('Set the privacy access level for all dead individuals.') ?>
</p>
@@ -94,7 +94,7 @@ use Fisharebest\Webtrees\View; ?>
</legend>
</div>
<div class="col-sm-8">
- <?= Bootstrap4::select(['0' => I18N::translate('Show to visitors'), '1' => I18N::translate('Show to members')], $tree->getPreference('HIDE_LIVE_PEOPLE'), ['id' => 'HIDE_LIVE_PEOPLE', 'name' => 'HIDE_LIVE_PEOPLE']) ?>
+ <?= view('components/select', ['name' => 'HIDE_LIVE_PEOPLE', 'selected' => $tree->getPreference('HIDE_LIVE_PEOPLE'), 'values' => ['0' => I18N::translate('Show to visitors'), '1' => I18N::translate('Show to members')]]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Show living individuals” configuration setting */ I18N::translate('If you show living individuals to visitors, all other privacy restrictions are ignored. Do this only if all the data in your tree is public.') ?>
</p>
@@ -136,7 +136,7 @@ use Fisharebest\Webtrees\View; ?>
</div>
</div>
<div class="col-sm-8">
- <?= Bootstrap4::select(array_slice(FunctionsEdit::optionsAccessLevels(), 0, 3, true), $tree->getPreference('SHOW_LIVING_NAMES'), ['id' => 'SHOW_LIVING_NAMES', 'name' => 'SHOW_LIVING_NAMES']) ?>
+ <?= view('components/select', ['name' => 'SHOW_LIVING_NAMES', 'selected' => $tree->getPreference('SHOW_LIVING_NAMES'), 'values' => array_slice(FunctionsEdit::optionsAccessLevels(), 0, 3, true)]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Show names of private individuals” configuration setting */ I18N::translate('This option will show the names (but no other details) of private individuals. Individuals are private if they are still alive or if a privacy restriction has been added to their individual record. To hide a specific name, add a privacy restriction to that name record.') ?>
</p>
@@ -155,7 +155,7 @@ use Fisharebest\Webtrees\View; ?>
</div>
</div>
<div class="col-sm-8">
- <?= Bootstrap4::select(['0' => I18N::translate('Hide from everyone'), '1' => I18N::translate('Show to visitors')], $tree->getPreference('SHOW_PRIVATE_RELATIONSHIPS'), ['id' => 'SHOW_PRIVATE_RELATIONSHIPS', 'name' => 'SHOW_PRIVATE_RELATIONSHIPS']) ?>
+ <?= view('components/select', ['name' => 'SHOW_PRIVATE_RELATIONSHIPS', 'selected' => $tree->getPreference('SHOW_PRIVATE_RELATIONSHIPS'), 'values' => ['0' => I18N::translate('Hide from everyone'), '1' => I18N::translate('Show to visitors')]]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Show private relationships” configuration setting */ I18N::translate('This option will retain family links in private records. This means that you will see empty “private” boxes on the pedigree chart and on other charts with private individuals.') ?>
</p>
@@ -178,29 +178,29 @@ use Fisharebest\Webtrees\View; ?>
<option value="media"><?= I18N::translate('Media object') ?></option>
</select>
<span class="select-record select-individual">
- <?= FunctionsEdit::formControlIndividual($tree, null, ['name' => 'xref[]', 'class' => 'form-control', 'style' => 'width:100%;']) ?>
+ <?= view('components/select-individual', ['name' => 'xref[]', 'id' => Uuid::uuid4()->toString(), 'tree' => $tree]) ?>
</span>
<span class="select-record select-family d-none">
- <?= FunctionsEdit::formControlFamily($tree, null, ['name' => 'xref[]', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
+ <?= view('components/select-family', ['name' => 'xref[]', 'id' => Uuid::uuid4()->toString(), 'tree' => $tree, 'disabled' => true]) ?>
</span>
<span class="select-record select-source d-none">
- <?= FunctionsEdit::formControlSource($tree, null, ['name' => 'xref[]', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
+ <?= view('components/select-source', ['name' => 'xref[]', 'id' => Uuid::uuid4()->toString(), 'tree' => $tree, 'disabled' => true]) ?>
</span>
<span class="select-record select-repository d-none">
- <?= FunctionsEdit::formControlRepository($tree, null, ['name' => 'xref[]', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
+ <?= view('components/select-repository', ['name' => 'xref[]', 'id' => Uuid::uuid4()->toString(), 'tree' => $tree, 'disabled' => true]) ?>
</span>
<span class="select-record select-note d-none">
- <?= FunctionsEdit::formControlNote($tree, null, ['name' => 'xref[]', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
+ <?= view('components/select-note', ['name' => 'xref[]', 'id' => Uuid::uuid4()->toString(), 'tree' => $tree, 'disabled' => true]) ?>
</span>
<span class="select-record select-media d-none">
- <?= FunctionsEdit::formControlMediaObject($tree, null, ['name' => 'xref[]', 'class' => 'form-control', 'style' => 'width:100%;', 'disabled' => true]) ?>
+ <?= view('components/select-media', ['name' => 'xref[]', 'id' => Uuid::uuid4()->toString(), 'tree' => $tree, 'disabled' => true]) ?>
</span>
</td>
<td>
- <?= Bootstrap4::select($all_tags, '', ['name' => 'tag_type[]']) ?>
+ <?= view('components/select', ['name' => 'tag_type[]', 'id' => Uuid::uuid4()->toString(), 'selected' => '', 'values' => $all_tags]) ?>
</td>
<td>
- <?= Bootstrap4::select($privacy_constants, 'privacy', ['name' => 'resn[]']) ?>
+ <?= view('components/select', ['name' => 'resn[]', 'id' => Uuid::uuid4()->toString(), 'selected' => 'privacy', 'values' => $privacy_constants]) ?>
</td>
<td>
</td>
diff --git a/resources/views/admin/trees-unconnected.phtml b/resources/views/admin/trees-unconnected.phtml
index 96d4605ad6..46abd02e06 100644
--- a/resources/views/admin/trees-unconnected.phtml
+++ b/resources/views/admin/trees-unconnected.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('admin-trees', ['ged' => $tree->name()]) => I18N::translate('Manage family trees '), $title]]) ?>
@@ -8,7 +7,7 @@
<form class="form-inline">
<input type="hidden" name="route" value="admin-trees-unconnected"">
<input type="hidden" name="ged" value="<?= e($tree->name()) ?>">
- <?= Bootstrap4::checkbox(I18N::translate('Include associates'), true, ['checked' => $associates, 'name' => 'associates']) ?>
+ <?= view('components/checkbox-inline', ['label' => I18N::translate('Include associates'), 'checked' => $associates, 'name' => 'associates']) ?>
<button type="submit">
<?= I18N::translate('update') ?>
</button>
diff --git a/resources/views/admin/users-cleanup.phtml b/resources/views/admin/users-cleanup.phtml
index fd6cd35f25..0bf07ecc6b 100644
--- a/resources/views/admin/users-cleanup.phtml
+++ b/resources/views/admin/users-cleanup.phtml
@@ -1,6 +1,4 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\Carbon; ?>
-<?php use Fisharebest\Webtrees\Functions\FunctionsDate; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('admin-users') => I18N::translate('User administration'), $title]]) ?>
@@ -14,7 +12,7 @@
<?= I18N::translate('Number of months since the last sign-in for a user’s account to be considered inactive: ') ?>
</label>
<div class="col-sm-2">
- <?= Bootstrap4::select($options, $months, ['id' => 'months', 'name' => 'months']) ?>
+ <?= view('components/select', ['name' => 'months', 'selected' => $months, 'values' => $options]) ?>
</div>
<div class="col-sm-2">
<button type="submit" class="btn btn-primary">
diff --git a/resources/views/admin/users-edit.phtml b/resources/views/admin/users-edit.phtml
index 8b1ba4780a..955ba07d35 100644
--- a/resources/views/admin/users-edit.phtml
+++ b/resources/views/admin/users-edit.phtml
@@ -1,16 +1,12 @@
-<?php use Fisharebest\Webtrees\Auth;
-use Fisharebest\Webtrees\Bootstrap4;
-use Fisharebest\Webtrees\Functions\FunctionsEdit;
+<?php
+
+use Fisharebest\Webtrees\Auth;
use Fisharebest\Webtrees\Functions\FunctionsPrint;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Individual;
-use Fisharebest\Webtrees\View; ?>
-<?php ?>
-<?php ?>
-<?php ?>
-<?php ?>
-<?php ?>
-<?php ?>
+use Fisharebest\Webtrees\View;
+
+?>
<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('admin-users') => I18N::translate('User administration'), $title]]) ?>
@@ -126,7 +122,7 @@ use Fisharebest\Webtrees\View; ?>
<?= /* I18N: A configuration setting */ I18N::translate('Time zone') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select(array_combine(\DateTimeZone::listIdentifiers(), \DateTimeZone::listIdentifiers()), $user->getPreference('TIMEZONE', 'UTC'), ['id' => 'timezone', 'name' => 'timezone']) ?>
+ <?= view('components/select', ['name' => 'timezone', 'selected' => $user->getPreference('TIMEZONE', 'UTC'), 'values' => array_combine(\DateTimeZone::listIdentifiers(), \DateTimeZone::listIdentifiers())]) ?>
<p class="small text-muted">
<?= I18N::translate('The time zone is required for date calculations, such as knowing today’s date.') ?>
</p>
@@ -175,7 +171,7 @@ use Fisharebest\Webtrees\View; ?>
<?= /* I18N: A configuration setting */ I18N::translate('Preferred contact method') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($contact_methods, $user->getPreference('contactmethod'), ['id' => 'contact_method', 'name' => 'contact_method']) ?>
+ <?= view('components/select', ['name' => 'contact_method', 'selected' => $user->getPreference('contactmethod'), 'values' => $contact_methods]) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Preferred contact method” configuration setting */
I18N::translate('Site members can send each other messages. You can choose to how these messages are sent to you, or choose not receive them at all.') ?>
@@ -189,7 +185,7 @@ use Fisharebest\Webtrees\View; ?>
<?= I18N::translate('Theme') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($theme_options, $user->getPreference('theme'), ['id' => 'theme', 'name' => 'theme']) ?>
+ <?= view('components/select', ['name' => 'theme', 'selected' => $user->getPreference('theme'), 'values' => $theme_options]) ?>
</div>
</div>
@@ -316,7 +312,7 @@ use Fisharebest\Webtrees\View; ?>
</select>
</td>
<td>
- <?= FunctionsEdit::formControlIndividual($tree, Individual::getInstance($tree->getUserPreference($user, 'gedcomid'), $tree), ['id' => 'gedcomid' . $tree->id(), 'name' => 'gedcomid' . $tree->id()]) ?>
+ <?= view('components/select-individual', ['name' => 'gedcomid' . $tree->id(), 'individual' => Individual::getInstance($tree->getUserPreference($user, 'gedcomid'), $tree), 'tree' => $tree]) ?>
</td>
<td>
<select class="form-control" name="RELATIONSHIP_PATH_LENGTH<?= $tree->id() ?>" id="RELATIONSHIP_PATH_LENGTH<?= $tree->id() ?>" class="relpath">
diff --git a/resources/views/admin/users.phtml b/resources/views/admin/users.phtml
index 3635ed65bc..0e7b7300f4 100644
--- a/resources/views/admin/users.phtml
+++ b/resources/views/admin/users.phtml
@@ -5,7 +5,9 @@
<h1><?= $title ?></h1>
-<table class="table table-sm table-bordered table-user-list">
+<table class="table table-sm table-bordered table-user-list"
+ <?= view('lists/datatables-attributes') ?>
+>
<thead>
<tr>
<th><?= I18N::translate('Edit') ?></th>
@@ -29,15 +31,12 @@
<?php View::push('javascript') ?>
<script>
$(".table-user-list").dataTable({
- stateSave: true,
- stateDuration: 300,
processing: true,
serverSide: true,
ajax: {
url: "<?= e(route('admin-users-data')) ?>"
},
autoWidth: false,
- pageLength: <?= $page_size ?>,
sorting: [[2, "asc"]],
columns: [
/* details */ {sortable: false},
@@ -52,8 +51,7 @@
/* last_login */ {dataSort: 8},
/* verified */ null,
/* approved */ null
- ],
- <?= I18N::datatablesI18N() ?>
+ ]
}).fnFilter("<?= e($filter) ?>"); // Pre-fill the search box
</script>
<?php View::endpush() ?>
diff --git a/resources/views/branches-page.phtml b/resources/views/branches-page.phtml
index 2235d19b2c..d9b01a82ac 100644
--- a/resources/views/branches-page.phtml
+++ b/resources/views/branches-page.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<h2 class="wt-page-title">
@@ -26,8 +25,8 @@
<?= I18N::translate('Phonetic search') ?>
</legend>
<div class="col-sm-9 wt-page-options-value">
- <?= Bootstrap4::checkbox(I18N::translate('Russell'), true, ['name' => 'soundex_std', 'checked' => $soundex_std]) ?>
- <?= Bootstrap4::checkbox(I18N::translate('Daitch-Mokotoff'), true, ['name' => 'soundex_dm', 'checked' => $soundex_dm]) ?>
+ <?= view('components/checkbox-inline', ['label' => I18N::translate('Russell'), 'name' => 'soundex_std', 'checked' => $soundex_std]) ?>
+ <?= view('components/checkbox-inline', ['label' => I18N::translate('Daitch-Mokotoff'), 'name' => 'soundex_dm', 'checked' => $soundex_dm]) ?>
</div>
</div>
</fieldset>
diff --git a/resources/views/chart-box.phtml b/resources/views/chart-box.phtml
index eb9b8bcbe8..68bfaec9a9 100644
--- a/resources/views/chart-box.phtml
+++ b/resources/views/chart-box.phtml
@@ -31,7 +31,7 @@ $menus = $module_service->findByComponent(ModuleChartInterface::class, $individu
})->filter();
foreach ($individual->spouseFamilies() as $family) {
- $menus[] = new Menu('<strong>' . I18N::translate('Family with spouse') . '</strong>', $family->url());
+ $menus->push(new Menu('<strong>' . I18N::translate('Family with spouse') . '</strong>', $family->url()));
$spouse = $family->spouse($individual);
if ($spouse && $spouse->canShow()) {
$menus->push(new Menu($spouse->fullName(), $spouse->url()));
@@ -124,7 +124,9 @@ $id = Uuid::uuid4()->toString();
<div class="dropdown-menu dropdown-menu-right wt-chart-box-dropdown wt-chart-box-links-dropdown" style="position: inherit" aria-labelledby="#chart-box-menu-<?= $id ?>">
<?php foreach ($menus as $menu): ?>
- <?= $menu->getMenuAsList() ?>
+ <a class="dropdown-item p-1 <?= e($menu->getClass()) ?>" href="<?= e($menu->getLink()) ?>">
+ <?= $menu->getLabel() ?>
+ </a>
<?php endforeach ?>
</div>
</div>
diff --git a/resources/views/components/checkbox-inline.phtml b/resources/views/components/checkbox-inline.phtml
new file mode 100644
index 0000000000..9313046d1c
--- /dev/null
+++ b/resources/views/components/checkbox-inline.phtml
@@ -0,0 +1,25 @@
+<?php
+
+/**
+ * @var bool|null $checked
+ * @var bool|null $disabled
+ * @var string|null $id
+ * @var string $label
+ * @var string $name
+ * @var string $value
+ */
+
+?>
+
+<div class="form-check form-check-inline">
+ <input type="checkbox" class="form-check-input"
+ name="<?= e($name) ?>"
+ id="<?= e($id ?? $name . '-' . ($value ?? '1')) ?>"
+ value="<?= e($value ?? '1') ?>"
+ <?= $checked ?? false ? 'checked' : '' ?>
+ <?= $disabled ?? false ? 'disabled' : '' ?>
+ >
+ <label class="form-check-label" for="<?= e($id ?? $name . '-' . ($value ?? '1')) ?>">
+ <?= $label ?>
+ </label>
+</div>
diff --git a/resources/views/components/checkbox.phtml b/resources/views/components/checkbox.phtml
new file mode 100644
index 0000000000..f0fa040014
--- /dev/null
+++ b/resources/views/components/checkbox.phtml
@@ -0,0 +1,25 @@
+<?php
+
+/**
+ * @var bool|null $checked
+ * @var bool|null $disabled
+ * @var string|null $id
+ * @var string $label
+ * @var string $name
+ * @var string $value
+ */
+
+?>
+
+<div class="form-check">
+ <input type="checkbox" class="form-check-input"
+ name="<?= e($name) ?>"
+ id="<?= e($id ?? $name . '-' . ($value ?? '1')) ?>"
+ value="<?= e($value ?? '1') ?>"
+ <?= $checked ?? false ? 'checked' : '' ?>
+ <?= $disabled ?? false ? 'disabled' : '' ?>
+ >
+ <label class="form-check-label" for="<?= e($id ?? $name . '-' . ($value ?? '1')) ?>">
+ <?= $label ?>
+ </label>
+</div>
diff --git a/resources/views/components/radio-inline.phtml b/resources/views/components/radio-inline.phtml
index 3915398599..2089ac6e49 100644
--- a/resources/views/components/radio-inline.phtml
+++ b/resources/views/components/radio-inline.phtml
@@ -1,6 +1,25 @@
+<?php
+
+/**
+ * @var bool|null $checked
+ * @var bool|null $disabled
+ * @var string|null $id
+ * @var string $label
+ * @var string $name
+ * @var string $value
+ */
+
+?>
+
<div class="form-check form-check-inline">
- <input class="form-check-input" type="radio" name="<?= e($name) ?>" id="radio-<?= e($name) ?>-no" value="<?= $value ?>" <?= $checked ? 'checked' : '' ?>>
- <label class="form-check-label" for="radio-<?= e($name) ?>-no">
- <?= $text ?>
- </label>
+ <input type="radio" class="form-check-input"
+ name="<?= e($name) ?>"
+ id="<?= e($id ?? $name . '-' . $value) ?>"
+ value="<?= e($value) ?>"
+ <?= $checked ?? false ? 'checked' : '' ?>
+ <?= $disabled ?? false ? 'disabled' : '' ?>
+ >
+ <label class="form-check-label" for="<?= e($id ?? $name . '-' . $value) ?>">
+ <?= $label ?>
+ </label>
</div>
diff --git a/resources/views/components/radio.phtml b/resources/views/components/radio.phtml
index af8aade3ba..8fa9b8d4a1 100644
--- a/resources/views/components/radio.phtml
+++ b/resources/views/components/radio.phtml
@@ -1,6 +1,25 @@
+<?php
+
+/**
+ * @var bool|null $checked
+ * @var bool|null $disabled
+ * @var string|null $id
+ * @var string $label
+ * @var string $name
+ * @var string $value
+ */
+
+?>
+
<div class="form-check">
- <input class="form-check-input" type="radio" name="<?= e($name) ?>" id="radio-<?= e($id ?? $name) ?>-no" value="<?= $value ?>" <?= $checked ? 'checked' : '' ?>>
- <label class="form-check-label" for="radio-<?= e($id ?? $name) ?>-no">
- <?= $text ?>
+ <input type="radio" class="form-check-input"
+ name="<?= e($name) ?>"
+ id="<?= e($id ?? $name . '-' . $value) ?>"
+ value="<?= e($value) ?>"
+ <?= $checked ?? false ? 'checked' : '' ?>
+ <?= $disabled ?? false ? 'disabled' : '' ?>
+ >
+ <label class="form-check-label" for="<?= e($id ?? $name . '-' . $value) ?>">
+ <?= $label ?>
</label>
</div>
diff --git a/resources/views/components/radios-hide-show.phtml b/resources/views/components/radios-hide-show.phtml
deleted file mode 100644
index 77bc12c3dc..0000000000
--- a/resources/views/components/radios-hide-show.phtml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php use Fisharebest\Webtrees\I18N; ?>
-
-<div class="form-check form-check-inline">
- <input class="form-check-input" type="radio" name="<?= e($name) ?>" id="radio-<?= e($name) ?>-false" value="" <?= $value ? '' : 'checked' ?>>
- <label class="form-check-label" for="radio-<?= e($name) ?>-false">
- <?= I18N::translate('hide') ?>
- </label>
-</div>
-
-<div class="form-check form-check-inline">
- <input class="form-check-input" type="radio" name="<?= e($name) ?>" id="radio-<?= e($name) ?>-true" value="1" <?= $value ? 'checked' : '' ?>>
- <label class="form-check-label" for="radio-<?= e($name) ?>-true">
- <?= I18N::translate('show') ?>
- </label>
-</div>
diff --git a/resources/views/components/radios-inline.phtml b/resources/views/components/radios-inline.phtml
new file mode 100644
index 0000000000..8e15919bc4
--- /dev/null
+++ b/resources/views/components/radios-inline.phtml
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * @var string $name
+ * @var mixed $selected
+ * @var string[] $options
+ */
+
+?>
+
+<?php foreach ($options as $value => $label) : ?>
+ <?= view('components/radio-inline', ['label' => $label, 'name' => $name, 'value' => (string) $value, 'checked' => $value === $selected]) ?>
+<?php endforeach ?>
diff --git a/resources/views/components/radios-no-yes.phtml b/resources/views/components/radios-no-yes.phtml
deleted file mode 100644
index bbf638b99b..0000000000
--- a/resources/views/components/radios-no-yes.phtml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php use Fisharebest\Webtrees\I18N; ?>
-
-<div class="form-check form-check-inline">
- <input class="form-check-input" type="radio" name="<?= e($name) ?>" id="radio-<?= e($name) ?>-false" value="" <?= $value ? '' : 'checked' ?>>
- <label class="form-check-label" for="radio-<?= e($name) ?>-false">
- <?= I18N::translate('no') ?>
- </label>
-</div>
-
-<div class="form-check form-check-inline">
- <input class="form-check-input" type="radio" name="<?= e($name) ?>" id="radio-<?= e($name) ?>-true" value="1" <?= $value ? 'checked' : '' ?>>
- <label class="form-check-label" for="radio-<?= e($name) ?>-true">
- <?= I18N::translate('yes') ?>
- </label>
-</div>
diff --git a/resources/views/components/radios.phtml b/resources/views/components/radios.phtml
new file mode 100644
index 0000000000..9c00052934
--- /dev/null
+++ b/resources/views/components/radios.phtml
@@ -0,0 +1,13 @@
+<?php
+
+/**
+ * @var string $name
+ * @var mixed $selected
+ * @var string[] $options
+ */
+
+?>
+
+<?php foreach ($options as $value => $label) : ?>
+ <?= view('components/radio', ['label' => $label, 'name' => $name, 'value' => (string) $value, 'checked' => $value === $selected]) ?>
+<?php endforeach ?>
diff --git a/resources/views/components/select-family.phtml b/resources/views/components/select-family.phtml
new file mode 100644
index 0000000000..67941a1626
--- /dev/null
+++ b/resources/views/components/select-family.phtml
@@ -0,0 +1,35 @@
+<?php
+
+use Fisharebest\Webtrees\Family;
+use Fisharebest\Webtrees\Tree;
+
+/**
+ * @var Family|null $family
+ * @var string|null $id
+ * @var string $name
+ * @var Tree $tree
+ */
+
+?>
+
+<select
+ autocomplete="off"
+ class="form-control select2"
+ data-ajax--delay="350"
+ data-ajax--minimum-input-length="2"
+ data-ajax--type="POST"
+ data-ajax--url="<?= e(route('select2-family', ['ged' => $tree->name()])) ?>"
+ data-allow-clear="true"
+ id="<?= e($id ?? $name) ?>"
+ name="<?= e($name) ?>"
+ <?= ($disabled ?? false) ? 'disabled' : '' ?>
+ <?= ($required ?? false) ? 'required' : '' ?>
+>
+ <?php if (($family ?? null) instanceof Family): ?>
+ <option value="<?= e($family->xref()) ?>" selected>
+ <?= view('selects/family', ['family' => $family]) ?>
+ </option>
+ <?php else: ?>
+ <option></option>
+ <?php endif ?>
+</select>
diff --git a/resources/views/components/select-individual.phtml b/resources/views/components/select-individual.phtml
new file mode 100644
index 0000000000..e224e4e796
--- /dev/null
+++ b/resources/views/components/select-individual.phtml
@@ -0,0 +1,35 @@
+<?php
+
+use Fisharebest\Webtrees\Individual;
+use Fisharebest\Webtrees\Tree;
+
+/**
+ * @var Individual|null $individual
+ * @var string|null $id
+ * @var string $name
+ * @var Tree $tree
+ */
+
+?>
+
+<select
+ autocomplete="off"
+ class="form-control select2"
+ data-ajax--delay="350"
+ data-ajax--minimum-input-length="2"
+ data-ajax--type="POST"
+ data-ajax--url="<?= e(route('select2-individual', ['ged' => $tree->name()])) ?>"
+ data-allow-clear="true"
+ id="<?= e($id ?? $name) ?>"
+ name="<?= e($name) ?>"
+ <?= ($disabled ?? false) ? 'disabled' : '' ?>
+ <?= ($required ?? false) ? 'required' : '' ?>
+>
+ <?php if (($individual ?? null) instanceof Individual): ?>
+ <option value="<?= e($individual->xref()) ?>" selected>
+ <?= view('selects/individual', ['individual' => $individual]) ?>
+ </option>
+ <?php else: ?>
+ <option></option>
+ <?php endif ?>
+</select>
diff --git a/resources/views/components/select-media.phtml b/resources/views/components/select-media.phtml
new file mode 100644
index 0000000000..019c992895
--- /dev/null
+++ b/resources/views/components/select-media.phtml
@@ -0,0 +1,35 @@
+<?php
+
+use Fisharebest\Webtrees\Media;
+use Fisharebest\Webtrees\Tree;
+
+/**
+ * @var Media|null $media
+ * @var string|null $id
+ * @var string $name
+ * @var Tree $tree
+ */
+
+?>
+
+<select
+ autocomplete="off"
+ class="form-control select2"
+ data-ajax--delay="350"
+ data-ajax--minimum-input-length="2"
+ data-ajax--type="POST"
+ data-ajax--url="<?= e(route('select2-media', ['ged' => $tree->name()])) ?>"
+ data-allow-clear="true"
+ id="<?= e($id ?? $name) ?>"
+ name="<?= e($name) ?>"
+ <?= ($disabled ?? false) ? 'disabled' : '' ?>
+ <?= ($required ?? false) ? 'required' : '' ?>
+>
+ <?php if (($media ?? null) instanceof Media): ?>
+ <option value="<?= e($media->xref()) ?>" selected>
+ <?= view('selects/media', ['media' => $media]) ?>
+ </option>
+ <?php else: ?>
+ <option></option>
+ <?php endif ?>
+</select>
diff --git a/resources/views/components/select-note.phtml b/resources/views/components/select-note.phtml
new file mode 100644
index 0000000000..04dcb39edd
--- /dev/null
+++ b/resources/views/components/select-note.phtml
@@ -0,0 +1,35 @@
+<?php
+
+use Fisharebest\Webtrees\Note;
+use Fisharebest\Webtrees\Tree;
+
+/**
+ * @var Note|null $note
+ * @var string|null $id
+ * @var string $name
+ * @var Tree $tree
+ */
+
+?>
+
+<select
+ autocomplete="off"
+ class="form-control select2"
+ data-ajax--delay="350"
+ data-ajax--minimum-input-length="2"
+ data-ajax--type="POST"
+ data-ajax--url="<?= e(route('select2-note', ['ged' => $tree->name()])) ?>"
+ data-allow-clear="true"
+ id="<?= e($id ?? $name) ?>"
+ name="<?= e($name) ?>"
+ <?= ($disabled ?? false) ? 'disabled' : '' ?>
+ <?= ($required ?? false) ? 'required' : '' ?>
+>
+ <?php if (($note ?? null) instanceof Note): ?>
+ <option value="<?= e($note->xref()) ?>" selected>
+ <?= view('selects/note', ['note' => $note]) ?>
+ </option>
+ <?php else: ?>
+ <option></option>
+ <?php endif ?>
+</select>
diff --git a/resources/views/components/select-repository.phtml b/resources/views/components/select-repository.phtml
new file mode 100644
index 0000000000..0ca5583b64
--- /dev/null
+++ b/resources/views/components/select-repository.phtml
@@ -0,0 +1,35 @@
+<?php
+
+use Fisharebest\Webtrees\Repository;
+use Fisharebest\Webtrees\Tree;
+
+/**
+ * @var Repository|null $repository
+ * @var string|null $id
+ * @var string $name
+ * @var Tree $tree
+ */
+
+?>
+
+<select
+ autocomplete="off"
+ class="form-control select2"
+ data-ajax--delay="350"
+ data-ajax--minimum-input-length="2"
+ data-ajax--type="POST"
+ data-ajax--url="<?= e(route('select2-repository', ['ged' => $tree->name()])) ?>"
+ data-allow-clear="true"
+ id="<?= e($id ?? $name) ?>"
+ name="<?= e($name) ?>"
+ <?= ($disabled ?? false) ? 'disabled' : '' ?>
+ <?= ($required ?? false) ? 'required' : '' ?>
+>
+ <?php if (($repository ?? null) instanceof Repository): ?>
+ <option value="<?= e($repository->xref()) ?>" selected>
+ <?= view('selects/repository', ['repository' => $repository]) ?>
+ </option>
+ <?php else: ?>
+ <option></option>
+ <?php endif ?>
+</select>
diff --git a/resources/views/components/select-source.phtml b/resources/views/components/select-source.phtml
new file mode 100644
index 0000000000..3bda406fc5
--- /dev/null
+++ b/resources/views/components/select-source.phtml
@@ -0,0 +1,35 @@
+<?php
+
+use Fisharebest\Webtrees\Source;
+use Fisharebest\Webtrees\Tree;
+
+/**
+ * @var Source|null $source
+ * @var string|null $id
+ * @var string $name
+ * @var Tree $tree
+ */
+
+?>
+
+<select
+ autocomplete="off"
+ class="form-control select2"
+ data-ajax--delay="350"
+ data-ajax--minimum-input-length="2"
+ data-ajax--type="POST"
+ data-ajax--url="<?= e(route('select2-source', ['ged' => $tree->name()])) ?>"
+ data-allow-clear="true"
+ id="<?= e($id ?? $name) ?>"
+ name="<?= e($name) ?>"
+ <?= ($disabled ?? false) ? 'disabled' : '' ?>
+ <?= ($required ?? false) ? 'required' : '' ?>
+>
+ <?php if (($source ?? null) instanceof Source): ?>
+ <option value="<?= e($source->xref()) ?>" selected>
+ <?= view('selects/source', ['source' => $source]) ?>
+ </option>
+ <?php else: ?>
+ <option></option>
+ <?php endif ?>
+</select>
diff --git a/resources/views/components/select-submitter.phtml b/resources/views/components/select-submitter.phtml
new file mode 100644
index 0000000000..5971a53999
--- /dev/null
+++ b/resources/views/components/select-submitter.phtml
@@ -0,0 +1,35 @@
+<?php
+
+use Fisharebest\Webtrees\GedcomRecord;
+use Fisharebest\Webtrees\Tree;
+
+/**
+ * @var GedcomRecord|null $submitter
+ * @var string|null $id
+ * @var string $name
+ * @var Tree $tree
+ */
+
+?>
+
+<select
+autocomplete="off"
+class="form-control select2"
+data-ajax--delay="350"
+data-ajax--minimum-input-length="2"
+data-ajax--type="POST"
+data-ajax--url="<?= e(route('select2-submitter', ['ged' => $tree->name()])) ?>"
+data-allow-clear="true"
+id="<?= e($id ?? $name) ?>"
+name="<?= e($name) ?>"
+ <?= ($disabled ?? false) ? 'disabled' : '' ?>
+ <?= ($required ?? false) ? 'required' : '' ?>
+>
+ <?php if (($submitter ?? null) instanceof GedcomRecord): ?>
+ <option value="<?= e($submitter->xref()) ?>" selected>
+ <?= view('selects/submitter', ['submitter' => $submitter]) ?>
+ </option>
+ <?php else: ?>
+ <option></option>
+ <?php endif ?>
+</select>
diff --git a/resources/views/components/select.phtml b/resources/views/components/select.phtml
new file mode 100644
index 0000000000..018cd7cad6
--- /dev/null
+++ b/resources/views/components/select.phtml
@@ -0,0 +1,24 @@
+<?php
+
+/**
+ * @var string|null $class
+ * @var string|null $id
+ * @var string $name
+ * @var mixed $selected
+ * @var string[] $values
+ */
+
+?>
+
+<select
+ class="form-control <?= $class ?? '' ?>"
+ name="<?= e($name) ?>"
+ id="<?= e($id ?? $name) ?>"
+ <?= is_array($selected) ? 'multiple' : '' ?>
+>
+ <?php foreach ($values as $key => $value) : ?>
+ <option value="<?= e((string) $key) ?>" <?= is_array($selected) && in_array($key, $selected, true) || $key === $selected ? 'selected' : '' ?>>
+ <?= e($value) ?>
+ </option>
+ <?php endforeach ?>
+</select>
diff --git a/resources/views/edit-account-page.phtml b/resources/views/edit-account-page.phtml
index e558aac29d..abb73fdc85 100644
--- a/resources/views/edit-account-page.phtml
+++ b/resources/views/edit-account-page.phtml
@@ -1,5 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?php use Fisharebest\Webtrees\View; ?>
@@ -58,8 +56,7 @@
<?= I18N::translate('Default individual') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= FunctionsEdit::formControlIndividual($tree, $default_individual, ['id' => 'root-id',
- 'name' => 'root_id', 'aria-describedby' => 'root-id-description']) ?>
+ <?= view('components/select-individual', ['name' => 'root_id', 'id' => 'root-id', 'individual' => $default_individual, 'tree' => $tree]) ?>
<p class="small text-muted" id="root-id-description">
<?= I18N::translate('This individual will be selected by default when viewing charts and reports.') ?>
</p>
@@ -85,7 +82,7 @@
<?= I18N::translate('Language') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= Bootstrap4::select($installed_languages, $user->getPreference('language'), ['id' => 'language', 'name' => 'language']) ?>
+ <?= view('components/select', ['name' => 'language', 'selected' => $user->getPreference('language'), 'values' => $installed_languages]) ?>
</div>
</div>
@@ -94,7 +91,7 @@
<?= I18N::translate('Time zone') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= Bootstrap4::select($timezones, $user->getPreference('TIMEZONE', 'UTC'), ['id' => 'timezone', 'name' => 'timezone', 'aria-describedby' => 'timezone-description']) ?>
+ <?= view('components/select', ['name' => 'timezone', 'selected' => $user->getPreference('TIMEZONE', 'UTC'), 'values' => $timezones]) ?>
<p class="small text-muted" id="timezone-description">
<?= I18N::translate('The time zone is required for date calculations, such as knowing today’s date.') ?>
</p>
@@ -119,7 +116,7 @@
<?= I18N::translate('Theme') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= Bootstrap4::select($themes, $user->getPreference('theme'), ['id' => 'theme', 'name' => 'theme', 'aria-describedby' => 'theme-description']) ?>
+ <?= view('components/select', ['name' => 'theme', 'selected' => $user->getPreference('theme'), 'values' => $themes]) ?>
<p class="small text-muted" id="theme-description">
<?= /* I18N: Help text for the "Default theme" site configuration setting */
I18N::translate('You can change the appearance of webtrees using “themes”. Each theme has a different style, layout, color scheme, etc.') ?>
@@ -133,7 +130,7 @@
<?= I18N::translate('Contact method') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= Bootstrap4::select($contact_methods, $user->getPreference('contactmethod'), ['id' => 'contact-method', 'name' => 'contact_method', 'aria-describedby' => 'contact-method-description']) ?>
+ <?= view('components/select', ['name' => 'contact_method', 'id' => 'contact-method', 'selected' => $user->getPreference('contactmethod'), 'values' => $contact_methods]) ?>
<p class="small text-muted" id="contact-method-description">
<?= I18N::translate('Site members can send each other messages. You can choose to how these messages are sent to you, or choose not receive them at all.') ?>
</p>
@@ -146,7 +143,7 @@
<?= I18N::translate('Visible online') ?>
</legend>
<div class="col-sm-9 wt-page-options-value">
- <?= Bootstrap4::checkbox(I18N::translate('Visible to other users when online'), false, ['name' => 'visible_online', 'checked' => (bool) $user->getPreference('visibleonline'), 'aria-describedby' => 'visible-online-description']) ?>
+ <?= view('components/checkbox', ['label' => I18N::translate('Visible to other users when online'), 'name' => 'visible_online', 'checked' => (bool) $user->getPreference('visibleonline')]) ?>
<p class="small text-muted" id="visible-online-description">
<?= I18N::translate('You can choose whether to appear in the list of users who are currently signed-in.') ?>
</p>
diff --git a/resources/views/edit/add-fact.phtml b/resources/views/edit/add-fact.phtml
index 32d5a9a316..dc3597c780 100644
--- a/resources/views/edit/add-fact.phtml
+++ b/resources/views/edit/add-fact.phtml
@@ -1,5 +1,4 @@
<?php use Fisharebest\Webtrees\Auth; ?>
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\Config; ?>
<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\GedcomTag; ?>
@@ -63,7 +62,7 @@
<?= I18N::translate('Last change') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::checkbox(I18N::translate('Keep the existing “last change” information'), true, ['name' => 'keep_chan', 'checked' => (bool) $tree->getPreference('NO_UPDATE_CHAN')]) ?>
+ <?= view('components/checkbox-inline', ['label' => I18N::translate('Keep the existing “last change” information'), 'name' => 'keep_chan', 'checked' => (bool) $tree->getPreference('NO_UPDATE_CHAN')]) ?>
<?= GedcomTag::getLabelValue('DATE', view('components/datetime', ['timestamp' => $record->lastChangeTimestamp()])) ?>
<?= GedcomTag::getLabelValue('_WT_USER', e($record->lastChangeUser())) ?>
</div>
diff --git a/resources/views/edit/change-family-members.phtml b/resources/views/edit/change-family-members.phtml
index 2c3be8b9e5..37cd116ceb 100644
--- a/resources/views/edit/change-family-members.phtml
+++ b/resources/views/edit/change-family-members.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<h2 class="wt-page-title"><?= $title ?></h2>
@@ -20,7 +19,7 @@
<?php endif ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= FunctionsEdit::formControlIndividual($tree, $father, ['id' => 'HUSB', 'name' => 'HUSB']) ?>
+ <?= view('components/select-individual', ['name' => 'HUSB', 'individual' => $father, 'tree' => $tree]) ?>
</div>
</div>
@@ -35,7 +34,7 @@
<?php endif ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= FunctionsEdit::formControlIndividual($tree, $mother, ['id' => 'WIFE', 'name' => 'WIFE']) ?>
+ <?= view('components/select-individual', ['name' => 'WIFE', 'individual' => $mother, 'tree' => $tree]) ?>
</div>
</div>
@@ -51,7 +50,7 @@
<?php endif ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= FunctionsEdit::formControlIndividual($tree, $child, ['id' => 'CHIL' . $n, 'name' => 'CHIL[]']) ?>
+ <?= view('components/select-individual', ['name' => 'CHIL[]', 'id' => 'CHIL' . $n, 'individual' => $child, 'tree' => $tree]) ?>
</div>
</div>
<?php endforeach ?>
@@ -61,7 +60,7 @@
<?= I18N::translate('Child') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= FunctionsEdit::formControlIndividual($tree, null, ['id' => 'CHIL[]' . (count($children) + 1), 'name' => 'CHIL[]']) ?>
+ <?= view('components/select-individual', ['name' => 'CHIL[]', 'id' => 'CHIL' . (count($children) + 1), 'tree' => $tree]) ?>
</div>
</div>
diff --git a/resources/views/edit/edit-fact.phtml b/resources/views/edit/edit-fact.phtml
index c11c84c254..d8b0f150c4 100644
--- a/resources/views/edit/edit-fact.phtml
+++ b/resources/views/edit/edit-fact.phtml
@@ -1,5 +1,4 @@
<?php use Fisharebest\Webtrees\Auth; ?>
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\Config; ?>
<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\GedcomTag; ?>
@@ -77,7 +76,7 @@
<?= I18N::translate('Last change') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::checkbox(I18N::translate('Keep the existing “last change” information'), true, ['name' => 'keep_chan', 'checked' => (bool) $tree->getPreference('NO_UPDATE_CHAN')]) ?>
+ <?= view('components/checkbox-inline', ['label' => I18N::translate('Keep the existing “last change” information'), 'name' => 'keep_chan', 'checked' => (bool) $tree->getPreference('NO_UPDATE_CHAN')]) ?>
<?= GedcomTag::getLabelValue('DATE', view('components/datetime', ['timestamp' => $record->lastChangeTimestamp()])) ?>
<?= GedcomTag::getLabelValue('_WT_USER', e($record->lastChangeUser())) ?>
</div>
diff --git a/resources/views/edit/link-child-to-family.phtml b/resources/views/edit/link-child-to-family.phtml
index 76aeec84b2..cc8b63d997 100644
--- a/resources/views/edit/link-child-to-family.phtml
+++ b/resources/views/edit/link-child-to-family.phtml
@@ -1,5 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\GedcomCode\GedcomCodePedi; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
@@ -13,7 +11,7 @@
<?= I18N::translate('Family') ?>
</label>
<div class="col-sm-9">
- <?= FunctionsEdit::formControlFamily($tree, null, ['id' => 'famid', 'name' => 'famid']) ?>
+ <?= view('components/select-family', ['name' => 'famid', 'tree' => $tree]) ?>
</div>
</div>
@@ -22,7 +20,7 @@
<?= I18N::translate('Pedigree') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select(GedcomCodePedi::getValues($individual), '', ['id' => 'PEDI', 'name' => 'PEDI']) ?>
+ <?= view('components/select', ['name' => 'PEDI', 'selected' => '', 'values' => GedcomCodePedi::getValues($individual)]) ?>
<p class="small text-muted">
<?= I18N::translate('A child may have more than one set of parents. The relationship between the child and the parents can be biological, legal, or based on local culture and tradition. If no pedigree is specified, then a biological relationship will be assumed.') ?>
</p>
diff --git a/resources/views/edit/link-spouse-to-individual.phtml b/resources/views/edit/link-spouse-to-individual.phtml
index bc31e460b2..42600075ed 100644
--- a/resources/views/edit/link-spouse-to-individual.phtml
+++ b/resources/views/edit/link-spouse-to-individual.phtml
@@ -11,7 +11,7 @@
<?= $label ?>
</label>
<div class="col-sm-9">
- <?= FunctionsEdit::formControlIndividual($tree, null, ['id' => 'spouse', 'name' => 'spid']) ?>
+ <?= view('components/select-individual', ['name' => 'spid', 'id' => 'spouse', 'tree' => $tree]) ?>
</div>
</div>
diff --git a/resources/views/edit/new-individual.phtml b/resources/views/edit/new-individual.phtml
index 17dff32b9f..33cc0563d9 100644
--- a/resources/views/edit/new-individual.phtml
+++ b/resources/views/edit/new-individual.phtml
@@ -1,7 +1,6 @@
<?php
use Fisharebest\Webtrees\Auth;
-use Fisharebest\Webtrees\Config;
use Fisharebest\Webtrees\Fact;
use Fisharebest\Webtrees\Functions\FunctionsEdit;
use Fisharebest\Webtrees\Gedcom;
diff --git a/resources/views/interactive-tree-page.phtml b/resources/views/interactive-tree-page.phtml
index 928bfbb05a..3802669ec0 100644
--- a/resources/views/interactive-tree-page.phtml
+++ b/resources/views/interactive-tree-page.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?php use Fisharebest\Webtrees\View; ?>
<?php use Fisharebest\Webtrees\Webtrees; ?>
@@ -18,7 +17,7 @@
<?= I18N::translate('Individual') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= FunctionsEdit::formControlIndividual($individual->tree(), $individual, ['id' => 'xref', 'name' => 'xref']) ?>
+ <?= view('components/select-individual', ['name' => 'xref', 'individual' => $individual, 'tree' => $individual->tree()]) ?>
</div>
</div>
diff --git a/resources/views/layouts/default.phtml b/resources/views/layouts/default.phtml
index 069e3b677f..36af715975 100644
--- a/resources/views/layouts/default.phtml
+++ b/resources/views/layouts/default.phtml
@@ -1,7 +1,6 @@
<?php use Fisharebest\Webtrees\DebugBar; ?>
<?php use Fisharebest\Webtrees\FlashMessages; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
-<?php use Fisharebest\Webtrees\Module\ModuleAnalyticsInterface; ?>
<?php use Fisharebest\Webtrees\Module\ModuleFooterInterface; ?>
<?php use Fisharebest\Webtrees\Module\ModuleGlobalInterface; ?>
<?php use Fisharebest\Webtrees\Module\ModuleThemeInterface; ?>
@@ -81,11 +80,11 @@
<div class="input-group">
<label class="sr-only" for="quick-search"><?= I18N::translate('Search') ?></label>
<input type="search" class="form-control wt-header-search-field" id="quick-search" name="query" size="15" placeholder="<?= I18N::translate('Search') ?>">
- <span class="input-group-btn">
+ <div class="input-group-append">
<button type="submit" class="btn btn-primary wt-header-search-button">
<?= view('icons/search') ?>
</button>
- </span>
+ </div>
</div>
</form>
</div>
diff --git a/resources/views/lists/datatables-attributes.phtml b/resources/views/lists/datatables-attributes.phtml
index 725f3406fc..ec292a135e 100644
--- a/resources/views/lists/datatables-attributes.phtml
+++ b/resources/views/lists/datatables-attributes.phtml
@@ -2,6 +2,8 @@
data-dom="<&quot;d-flex justify-content-between&quot;prf><t><&quot;d-flex justify-content-between&quot;il>"
data-state-save="true"
+data-state-duration="3600"
+data-length-menu="<?= e(json_encode([[10, 20, 50, 100, 500, 1000, -1], [I18N::number(10), I18N::number(20), I18N::number(50), I18N::number(100), I18N::number(500), I18N::number(1000), I18N::translate('All')]])) ?>"
data-language="<?= e(json_encode([
'paginate' => [
/* I18N: A button label, first page */
diff --git a/resources/views/lists/families-table.phtml b/resources/views/lists/families-table.phtml
index ad0fbb1dbf..fece235b81 100644
--- a/resources/views/lists/families-table.phtml
+++ b/resources/views/lists/families-table.phtml
@@ -21,7 +21,6 @@ $hundred_years_ago = new Date($hundred_years_ago->format('Y'));
$("#<?= e($table_id) ?>").dataTable({
dom: '<"H"<"filtersH_<?= e($table_id) ?>"><"dt-clear">pf<"dt-clear">irl>t<"F"pl<"dt-clear"><"filtersF_<?= e($table_id) ?>">>',
- <?= I18N::datatablesI18N() ?>,
autoWidth: false,
processing: true,
retrieve: true,
@@ -43,9 +42,7 @@ $("#<?= e($table_id) ?>").dataTable({
],
sorting: [
[1, "asc"]
- ],
- displayLength: 20,
- pagingType: "full_numbers"
+ ]
});
$("#<?= e($table_id) ?>")
@@ -144,7 +141,9 @@ $marriageAgeData = [
?>
<div class="fam-list">
- <table id="<?= e($table_id) ?>">
+ <table id="<?= e($table_id) ?>"
+ <?= view('lists/datatables-attributes') ?>
+ >
<thead>
<tr>
<th colspan="14">
diff --git a/resources/views/lists/individuals-table.phtml b/resources/views/lists/individuals-table.phtml
index 4f0186c244..f9fd181490 100644
--- a/resources/views/lists/individuals-table.phtml
+++ b/resources/views/lists/individuals-table.phtml
@@ -34,7 +34,6 @@ $module = app(ModuleService::class)
$("#<?= e($table_id) ?>").dataTable({
dom: '<"H"<"filtersH_<?= e($table_id) ?>">T<"dt-clear">pf<"dt-clear">irl>t<"F"pl<"dt-clear"><"filtersF_<?= e($table_id) ?>">>',
- <?= I18N::datatablesI18N() ?>,
autoWidth: false,
processing: true,
retrieve: true,
@@ -56,9 +55,7 @@ $("#<?= e($table_id) ?>").dataTable({
/* Filter death */ { sortable: false },
/* Filter tree */ { sortable: false }
],
- sorting: <?= json_encode($sosa ? [[4, "asc"]] : [[1, "asc"]]) ?>,
- displayLength: 20,
- pagingType: "full_numbers"
+ sorting: <?= json_encode($sosa ? [[4, "asc"]] : [[1, "asc"]]) ?>
});
$("#<?= e($table_id) ?>")
@@ -157,7 +154,9 @@ $deathAgeData = [
?>
<div class="indi-list">
- <table id="<?= e($table_id) ?>">
+ <table id="<?= e($table_id) ?>"
+ <?= view('lists/datatables-attributes') ?>
+ >
<thead>
<tr>
<th colspan="16">
diff --git a/resources/views/media-list-page.phtml b/resources/views/media-list-page.phtml
index 8090ed4a9c..a054cb1c00 100644
--- a/resources/views/media-list-page.phtml
+++ b/resources/views/media-list-page.phtml
@@ -1,5 +1,4 @@
<?php use Fisharebest\Webtrees\Auth; ?>
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\Functions\FunctionsPrint; ?>
<?php use Fisharebest\Webtrees\Functions\FunctionsPrintFacts; ?>
@@ -23,15 +22,15 @@
<?= I18N::translate('Folder') ?>
</label>
<div class="col-sm-3 wt-page-options-value">
- <?= Bootstrap4::select($folders, $folder, ['id' => 'folder', 'name' => 'folder']) ?>
- <?= Bootstrap4::checkbox(/* I18N: Label for check-box */ I18N::translate('Include subfolders'), true, ['name' => 'subdirs', 'checked' => ($subdirs === '1')]) ?>
+ <?= view('components/select', ['name' => 'folder', 'selected' => $folder, 'values' => $folders]) ?>
+ <?= view('components/checkbox-inline', ['label' => /* I18N: Label for check-box */ I18N::translate('Include subfolders'), 'name' => 'subdirs', 'checked' => $subdirs === '1']) ?>
</div>
<label class="col-sm-3 col-form-label wt-page-options-label" for="max">
<?= I18N::translate('Media objects per page') ?>
</label>
<div class="col-sm-3 wt-page-options-value">
- <?= Bootstrap4::select(FunctionsEdit::numericOptions([10, 20, 30, 40, 50, 75, 100, 150, 200]), $max, ['id' => 'max', 'name' => 'max']) ?>
+ <?= view('components/select', ['name' => 'max', 'selected' => $max, 'values' => FunctionsEdit::numericOptions([10, 20, 30, 40, 50, 75, 100, 150, 200])]) ?>
</div>
</div>
@@ -40,7 +39,7 @@
<?= I18N::translate('Type') ?>
</label>
<div class="col-sm-3 wt-page-options-value">
- <?= Bootstrap4::select(['' => ''] + $formats, $form_type, ['id' => 'form-type', 'name' => 'form_type']) ?>
+ <?= view('components/select', ['name' => 'form_type', 'id' => 'form-type', 'selected' => $form_type, 'values' => ['' => ''] + $formats]) ?>
</div>
<div class="col-sm-3 col-form-label wt-page-options-label">
diff --git a/resources/views/modals/create-family.phtml b/resources/views/modals/create-family.phtml
index 5359ed91df..7b5c18fdda 100644
--- a/resources/views/modals/create-family.phtml
+++ b/resources/views/modals/create-family.phtml
@@ -1,5 +1,4 @@
<?php use Fisharebest\Webtrees\I18N; ?>
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<div class="modal wt-modal-create-record" id="modal-create-family">
<form action="<?= e(route('create-family')) ?>" id="form-create-family">
@@ -18,13 +17,13 @@
<label class="col-form-label" for="husband">
<?= I18N::translate('Husband') ?>
</label>
- <?= FunctionsEdit::formControlIndividual($tree, null, ['id' => 'husband', 'name' => 'husband']) ?>
+ <?= view('components/select-individual', ['name' => 'husband', 'tree' => $tree]) ?>
</div>
<div class="form-group">
<label class="col-form-label" for="wife">
<?= I18N::translate('Wife') ?>
</label>
- <?= FunctionsEdit::formControlIndividual($tree, null, ['id' => 'wife', 'name' => 'wife']) ?>
+ <?= view('components/select-individual', ['name' => 'wife', 'tree' => $tree]) ?>
</div>
</div>
<div class="modal-footer">
diff --git a/resources/views/modals/create-media-from-file.phtml b/resources/views/modals/create-media-from-file.phtml
index 16f0903a87..f4fd1a8994 100644
--- a/resources/views/modals/create-media-from-file.phtml
+++ b/resources/views/modals/create-media-from-file.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\GedcomTag; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
@@ -37,7 +36,7 @@
<?= I18N::translate('Media type') ?>
</label>
<div class="col-sm-10">
- <?= Bootstrap4::select(['' => ''] + GedcomTag::getFileFormTypes(), '') ?>
+ <?= view('components/select', ['name' => 'type', 'selected' => '', 'values' => ['' => ''] + GedcomTag::getFileFormTypes()]) ?>
</div>
</div>
<div class="form-group row">
diff --git a/resources/views/modals/link-media-to-family.phtml b/resources/views/modals/link-media-to-family.phtml
index 18e8814f22..7c105ac7b9 100644
--- a/resources/views/modals/link-media-to-family.phtml
+++ b/resources/views/modals/link-media-to-family.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<form action="<?= e(route('link-media-to-record')) ?>" id="wt-modal-form" method="POST">
@@ -13,7 +12,7 @@
<label class="col-form-label" for="link">
<?= I18N::translate('Family') ?>
</label>
- <?= FunctionsEdit::formControlFamily($tree, null, ['id' => 'link', 'name' => 'link']) ?>
+ <?= view('components/select-family', ['name' => 'link', 'tree' => $tree]) ?>
</div>
</div>
diff --git a/resources/views/modals/link-media-to-individual.phtml b/resources/views/modals/link-media-to-individual.phtml
index 63df4b3434..6ecefed236 100644
--- a/resources/views/modals/link-media-to-individual.phtml
+++ b/resources/views/modals/link-media-to-individual.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<form action="<?= e(route('link-media-to-record')) ?>" id="wt-modal-form" method="POST">
@@ -13,7 +12,7 @@
<label class="col-form-label" for="link">
<?= I18N::translate('Individual') ?>
</label>
- <?= FunctionsEdit::formControlIndividual($tree, null, ['id' => 'link', 'name' => 'link']) ?>
+ <?= view('components/select-individual', ['name' => 'link', 'tree' => $tree]) ?>
</div>
</div>
diff --git a/resources/views/modals/link-media-to-source.phtml b/resources/views/modals/link-media-to-source.phtml
index 3537e2673b..000cd0b436 100644
--- a/resources/views/modals/link-media-to-source.phtml
+++ b/resources/views/modals/link-media-to-source.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<form action="<?= e(route('link-media-to-record')) ?>" id="wt-modal-form" method="POST">
@@ -13,7 +12,7 @@
<label class="col-form-label" for="link">
<?= I18N::translate('Source') ?>
</label>
- <?= FunctionsEdit::formControlSource($tree, null, ['id' => 'link', 'name' => 'link']) ?>
+ <?= view('components/select-source', ['name' => 'link', 'tree' => $tree]) ?>
</div>
</div>
diff --git a/resources/views/modals/media-file-fields.phtml b/resources/views/modals/media-file-fields.phtml
index e8974083c2..e86bbbdcae 100644
--- a/resources/views/modals/media-file-fields.phtml
+++ b/resources/views/modals/media-file-fields.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\GedcomTag; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
@@ -77,7 +76,7 @@
<?= I18N::translate('A file on the server') ?>
</label>
<div class="col-sm-10">
- <?= Bootstrap4::select($unused_files, '', ['id' => 'unused', 'name' => 'unused']) ?>
+ <?= view('components/select', ['name' => 'unused', 'selected' => '', 'values' => $unused_files]) ?>
<small class="text-muted">
</small>
</div>
@@ -113,7 +112,7 @@
<?= I18N::translate('Media type') ?>
</label>
<div class="col-sm-10">
- <?= Bootstrap4::select(['' => ''] + GedcomTag::getFileFormTypes(), $media_file ? $media_file->type() : '', ['id' => 'type', 'name' => 'type']) ?>
+ <?= view('components/select', ['name' => 'type', 'selected' => $media_file ? $media_file->type() : '', 'values' => ['' => ''] + GedcomTag::getFileFormTypes()]) ?>
</div>
</div>
diff --git a/resources/views/modals/source-fields.phtml b/resources/views/modals/source-fields.phtml
index 8ee70f7d82..d17a8aa592 100644
--- a/resources/views/modals/source-fields.phtml
+++ b/resources/views/modals/source-fields.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<div class="form-group row">
@@ -36,7 +35,7 @@
<?= I18N::translate('Repository') ?>
</label>
<div class="col-sm-4">
- <?= FunctionsEdit::formControlRepository($tree, null, ['id' => 'source-repository', 'name' => 'source-repository']) ?>
+ <?= view('components/select-repository', ['name' => 'source-repository', 'tree' => $tree]) ?>
</div>
<label class="col-form-label col-sm-2" for="source-call-number">
<?= I18N::translate('Call number') ?>
diff --git a/resources/views/modules/ancestors-chart/page.phtml b/resources/views/modules/ancestors-chart/page.phtml
index c76b6feeaf..420f1f2a39 100644
--- a/resources/views/modules/ancestors-chart/page.phtml
+++ b/resources/views/modules/ancestors-chart/page.phtml
@@ -1,5 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?php use Fisharebest\Webtrees\View; ?>
@@ -18,7 +16,7 @@
<?= I18N::translate('Individual') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= FunctionsEdit::formControlIndividual($tree, $individual, ['id' => 'xref', 'name' => 'xref']) ?>
+ <?= view('components/select-individual', ['name' => 'xref', 'individual' => $individual, 'tree' => $tree]) ?>
</div>
</div>
@@ -37,8 +35,8 @@
<?= I18N::translate('Layout') ?>
</legend>
<div class="col-sm-9 wt-page-options-value">
- <?= Bootstrap4::radioButtons('chart_style', $chart_styles, $chart_style, true) ?>
- <?= Bootstrap4::checkbox(I18N::translate('Show cousins'), false, ['name' => 'show_cousins', 'disabled' => $chart_style !== 'booklet', 'checked' => $show_cousins]) ?>
+ <?= view('components/radios-inline', ['name' => 'chart_style', 'options' => $chart_styles, 'selected' => $chart_style]) ?>
+ <?= view('components/checkbox', ['label' => I18N::translate('Show cousins'), 'name' => 'show_cousins', 'disabled' => $chart_style !== 'booklet', 'checked' => $show_cousins]) ?>
</div>
</div>
</fieldset>
diff --git a/resources/views/modules/batch_update/admin.phtml b/resources/views/modules/batch_update/admin.phtml
index ca7f16ebca..3772a6a97d 100644
--- a/resources/views/modules/batch_update/admin.phtml
+++ b/resources/views/modules/batch_update/admin.phtml
@@ -1,11 +1,15 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
-<?php use Fisharebest\Webtrees\I18N; ?>
+<?php
+
+use Fisharebest\Webtrees\I18N;
+use Fisharebest\Webtrees\View;
+
+?>
<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('modules') => I18N::translate('Module administration'), $title]]) ?>
<h1><?= $title ?></h1>
-<form >
+<form id="batch-update-form">
<input type="hidden" name="route" value="module">
<input type="hidden" name="module" value="batch_update">
<input type="hidden" name="action" value="Admin">
@@ -15,13 +19,13 @@
<div class="row form-group">
<label class="col-sm-3 col-form-label"><?= I18N::translate('Family tree') ?></label>
<div class="col-sm-9">
- <?= Bootstrap4::select($trees, $tree->name(), ['id' => 'ged', 'name' => 'ged', 'onchange' => 'this.form.submit();']) ?>
+ <?= view('components/select', ['name' => 'ged', 'selected' => $tree->name(), 'values' => $trees]) ?>
</div>
</div>
<div class="row form-group">
<label class="col-sm-3 col-form-label"><?= I18N::translate('Batch update') ?></label>
<div class="col-sm-9">
- <select class="form-control" name="plugin" onchange="this.form.submit();">
+ <select class="form-control" name="plugin">
<?php if ($plugin === null) : ?>
<option value="" selected></option>
<?php endif ?>
@@ -79,9 +83,9 @@
<?= I18N::translate('Update all') ?>
</button>
<?php else : ?>
- <button class="btn btn-primary" disabled title="<?= I18N::translate('Your user account does not have “automatically accept changes” enabled. You will only be able to change one record at a time.') ?>">
- <?= I18N::translate('Update all') ?>
- </button>
+ <button class="btn btn-primary" disabled title="<?= I18N::translate('Your user account does not have “automatically accept changes” enabled. You will only be able to change one record at a time.') ?>">
+ <?= I18N::translate('Update all') ?>
+ </button>
<?php endif ?>
</div>
</div>
@@ -99,3 +103,11 @@
<?php endif ?>
<?php endif ?>
</form>
+
+<?php View::push('javascript') ?>
+<script>
+ $("#batch-update-form input, #batch-update-form select").change(function () {
+ $("#batch-update-form").submit();
+ });
+</script>
+<?php View::endpush() ?>
diff --git a/resources/views/modules/census-assistant.phtml b/resources/views/modules/census-assistant.phtml
index 0146b986c2..626cda6af7 100644
--- a/resources/views/modules/census-assistant.phtml
+++ b/resources/views/modules/census-assistant.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?php use Fisharebest\Webtrees\View; ?>
@@ -25,7 +24,7 @@
<div class="form-group col-sm-6">
<div class="input-group">
<div class="input-group-prepend">
- <label class="input-group-addon" for="census-assistant-citation">
+ <label class="input-group-text" for="census-assistant-citation">
<?= I18N::translate('Citation') ?>
</label>
</div>
@@ -52,17 +51,17 @@
<?= I18N::translate('Individuals') ?>
</span>
</div>
- <?= FunctionsEdit::formControlIndividual($individual->tree(), $individual, ['id' => 'census-assistant-individual', 'style' => 'width:100%']) ?>
- <span class="input-group-btn">
- <button type="button" class="btn btn-primary" id="census-assistant-add" aria-label="<?= I18N::translate('add') ?>">
- <?= view('icons/add') ?>
- </button>
- </span>
- <span class="input-group-btn">
- <button type="button" class="btn btn-primary" id="census-assistant-head" aria-label="<?= I18N::translate('Head of household') ?>">
- <?= view('icons/individual') ?>
- </button>
- </span>
+ <?= view('components/select-individual', ['name' => 'census-assistant-individual', 'individual' => $individual, 'tree' => $individual->tree()]) ?>
+ <div class="input-group-append">
+ <button type="button" class="btn btn-primary" id="census-assistant-add" aria-label="<?= I18N::translate('add') ?>">
+ <?= view('icons/add') ?>
+ </button>
+ </div>
+ <div class="input-group-append">
+ <button type="button" class="btn btn-primary" id="census-assistant-head" aria-label="<?= I18N::translate('Head of household') ?>">
+ <?= view('icons/individual') ?>
+ </button>
+ </div>
</div>
</div>
diff --git a/resources/views/modules/charts/config.phtml b/resources/views/modules/charts/config.phtml
index 1fdb03e789..365ba1b3b2 100644
--- a/resources/views/modules/charts/config.phtml
+++ b/resources/views/modules/charts/config.phtml
@@ -1,5 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<div class="form-group row">
@@ -7,7 +5,7 @@
<?= I18N::translate('Chart type') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($charts, $type, ['id' => 'type', 'name' => 'type']) ?>
+ <?= view('components/select', ['name' => 'type', 'selected' => $type, 'values' => $charts]) ?>
</div>
</div>
@@ -18,6 +16,6 @@
</label>
</label>
<div class="col-sm-9">
- <?= FunctionsEdit::formControlIndividual($tree, $individual, ['id' => 'pid', 'name' => 'pid']) ?>
+ <?= view('components/select-individual', ['name' => 'pid', 'individual' => $individual, 'tree' => $tree]) ?>
</div>
</div>
diff --git a/resources/views/modules/clippings/add-options.phtml b/resources/views/modules/clippings/add-options.phtml
index 837c83bdc4..9439f408fb 100644
--- a/resources/views/modules/clippings/add-options.phtml
+++ b/resources/views/modules/clippings/add-options.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<h2 class="wt-page-title"><?= $title ?></h2>
@@ -11,7 +10,7 @@
<?= I18N::translate('Add to the clippings cart') ?>
</div>
<div class="col-sm-9 wt-page-options-value">
- <?= Bootstrap4::radioButtons('option', $options, $default, false, []) ?>
+ <?= view('components/radios', ['name' => 'option', 'options' => $options, 'selected' => $default]) ?>
</div>
</div>
diff --git a/resources/views/modules/compact-chart/page.phtml b/resources/views/modules/compact-chart/page.phtml
index e99bc29cb8..fc31a96a96 100644
--- a/resources/views/modules/compact-chart/page.phtml
+++ b/resources/views/modules/compact-chart/page.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<h2 class="wt-page-title">
@@ -16,7 +15,7 @@
<?= I18N::translate('Individual') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= FunctionsEdit::formControlIndividual($individual->tree(), $individual, ['id' => 'xref', 'name' => 'xref']) ?>
+ <?= view('components/select-individual', ['name' => 'xref', 'individual' => $individual, 'tree' => $tree]) ?>
</div>
</div>
diff --git a/resources/views/modules/descendancy_chart/page.phtml b/resources/views/modules/descendancy_chart/page.phtml
index 013faf30f3..f389315869 100644
--- a/resources/views/modules/descendancy_chart/page.phtml
+++ b/resources/views/modules/descendancy_chart/page.phtml
@@ -1,5 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<h2 class="wt-page-title">
@@ -17,7 +15,7 @@
<?= I18N::translate('Individual') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= FunctionsEdit::formControlIndividual($tree, $individual, ['id' => 'xref', 'name' => 'xref']) ?>
+ <?= view('components/select-individual', ['name' => 'xref', 'individual' => $individual, 'tree' => $tree]) ?>
</div>
</div>
@@ -36,7 +34,7 @@
<?= I18N::translate('Layout') ?>
</legend>
<div class="col-sm-9 wt-page-options-value">
- <?= Bootstrap4::radioButtons('chart_style', $chart_styles, $chart_style, true) ?>
+ <?= view('components/radios-inline', ['name' => 'chart_style', 'options' => $chart_styles, 'selected' => $chart_style]) ?>
</div>
</div>
</fieldset>
diff --git a/resources/views/modules/family-book-chart/page.phtml b/resources/views/modules/family-book-chart/page.phtml
index 977d5740d6..f1bbace9c8 100644
--- a/resources/views/modules/family-book-chart/page.phtml
+++ b/resources/views/modules/family-book-chart/page.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
@@ -17,7 +16,7 @@
<?= I18N::translate('Individual') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= FunctionsEdit::formControlIndividual($individual->tree(), $individual, ['id' => 'xref', 'name' => 'xref']) ?>
+ <?= view('components/select-individual', ['name' => 'xref', 'individual' => $individual, 'tree' => $tree]) ?>
</div>
</div>
@@ -26,7 +25,7 @@
<?= I18N::translate('Generations') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= Bootstrap4::select(FunctionsEdit::numericOptions(range(2, 5)), $book_size, ['id' => 'book_size', 'name' => 'book_size']) ?>
+ <?= view('components/select', ['name' => 'book_size', 'selected' => $book_size, 'values' => FunctionsEdit::numericOptions(range(2, 5))]) ?>
</div>
</div>
@@ -35,7 +34,7 @@
<?= I18N::translate('Descendant generations') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= Bootstrap4::select(FunctionsEdit::numericOptions(range($minimum_generations, $maximum_generations)), $generations, ['id' => 'generations', 'name' => 'generations']) ?>
+ <?= view('components/select', ['name' => 'generations', 'selected' => $generations, 'values' => FunctionsEdit::numericOptions(range($minimum_generations, $maximum_generations))]) ?>
</div>
</div>
@@ -45,7 +44,7 @@
<?= I18N::translate('Spouses') ?>
</legend>
<div class="col-sm-9 wt-page-options-value">
- <?= Bootstrap4::checkbox(I18N::translate('Show spouses'), false, ['name' => 'show_spouse', 'checked' => $show_spouse]) ?>
+ <?= view('components/checkbox', ['label' => I18N::translate('Show spouses'), 'name' => 'show_spouse', 'checked' => $show_spouse]) ?>
</div>
</div>
</fieldset>
diff --git a/resources/views/modules/fanchart/page.phtml b/resources/views/modules/fanchart/page.phtml
index d6601e15d2..b3c9f8d119 100644
--- a/resources/views/modules/fanchart/page.phtml
+++ b/resources/views/modules/fanchart/page.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
@@ -17,7 +16,7 @@
<?= I18N::translate('Individual') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= FunctionsEdit::formControlIndividual($tree, $individual, ['id' => 'xref', 'name' => 'xref']) ?>
+ <?= view('components/select-individual', ['name' => 'xref', 'individual' => $individual, 'tree' => $tree]) ?>
</div>
</div>
@@ -26,7 +25,7 @@
<?= I18N::translate('Layout') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= Bootstrap4::select($chart_styles, $chart_style, ['id' => 'chart_style', 'name' => 'chart_style']) ?>
+ <?= view('components/select', ['name' => 'chart_style', 'selected' => $chart_style, 'values' => $chart_styles]) ?>
</div>
</div>
@@ -35,7 +34,7 @@
<?= I18N::translate('Generations') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= Bootstrap4::select(FunctionsEdit::numericOptions(range($minimum_generations, $maximum_generations)), $generations, ['id' => 'generations', 'name' => 'generations']) ?>
+ <?= view('components/select', ['name' => 'generations', 'selected' => $generations, 'values' => FunctionsEdit::numericOptions(range($minimum_generations, $maximum_generations))]) ?>
</div>
</div>
diff --git a/resources/views/modules/faq/config.phtml b/resources/views/modules/faq/config.phtml
index c682e63d53..8c36ce770c 100644
--- a/resources/views/modules/faq/config.phtml
+++ b/resources/views/modules/faq/config.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('modules') => I18N::translate('Modules'), $title]]) ?>
@@ -19,7 +18,7 @@
<label for="ged" class="sr-only">
<?= I18N::translate('Family tree') ?>
</label>
- <?= Bootstrap4::select($tree_names, $tree->name(), ['id' => 'ged', 'name' => 'ged']) ?>
+ <?= view('components/select', ['name' => 'ged', 'selected' => $tree->name(), 'values' => $tree_names]) ?>
<input type="submit" class="btn btn-primary" value="<?= I18N::translate('show') ?>">
</form>
</p>
diff --git a/resources/views/modules/faq/edit.phtml b/resources/views/modules/faq/edit.phtml
index 65d0969a71..5cc062483a 100644
--- a/resources/views/modules/faq/edit.phtml
+++ b/resources/views/modules/faq/edit.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
@@ -58,7 +57,7 @@
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select(['' => I18N::translate('All')] + $tree_names, $tree->name(), ['id' => 'gedcom_id', 'name' => 'gedcom_id']) ?>
+ <?= view('components/select', ['name' => 'gedcom_id', 'selected' => $tree->name(), 'values' => $tree_names]) ?>
<p class="small text-muted">
<?= /* I18N: FAQ = “Frequently Asked Question” */
I18N::translate('An FAQ can be displayed on just one of the family trees, or on all the family trees.') ?>
diff --git a/resources/views/modules/faq/list.phtml b/resources/views/modules/faq/list.phtml
deleted file mode 100644
index e159aa9626..0000000000
--- a/resources/views/modules/faq/list.phtml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?php use Fisharebest\Webtrees\I18N; ?>
-<?php use Fisharebest\Webtrees\View; ?>
-
-<h2 class="wt-page-title"><?= $title ?></h2>
-
-<table id="story_table" class="w-100">
- <thead>
- <tr>
- <th><?= I18N::translate('Story title') ?></th>
- <th><?= I18N::translate('Individual') ?></th>
- </tr>
- </thead>
- <tbody>
- <?php foreach ($stories as $story) : ?>
- <tr>
- <td>
- <?= e($story->title) ?>
- </td>
- <td>
- <a href="<?= e($story->individual->url()) ?>#tab-stories">
- <?= $story->individual->fullName() ?>
- </a>
- </td>
- </tr>
- <?php endforeach ?>
- </tbody>
-</table>
-
-<?php View::push('javascript') ?>
-<script>
- $("#story_table").dataTable({
- dom: '<"H"pf<"dt-clear">irl>t<"F"pl>',
- autoWidth: false,
- paging: true,
- pagingType: "full_numbers",
- lengthChange: true,
- filter: true,
- info: true,
- sorting: [[0,"asc"]],
- columns: [
- /* 0-name */ null,
- /* 1-NAME */ null
- ],
- <?= I18N::datatablesI18N() ?>
- });
-
-</script>
-<?php View::endpush() ?>
diff --git a/resources/views/modules/favorites/favorites.phtml b/resources/views/modules/favorites/favorites.phtml
index 6debbacdbe..66e9a751ee 100644
--- a/resources/views/modules/favorites/favorites.phtml
+++ b/resources/views/modules/favorites/favorites.phtml
@@ -1,6 +1,5 @@
<?php
-use Fisharebest\Webtrees\Functions\FunctionsEdit;
use Fisharebest\Webtrees\I18N;
use Fisharebest\Webtrees\Individual;
use Illuminate\Support\Collection;
@@ -66,19 +65,19 @@ use Illuminate\Support\Collection;
</div>
</div>
<div class="col-sm-8 col-md-9">
- <?= FunctionsEdit::formControlIndividual($tree, null, ['id' => 'xref', 'name' => 'indi-xref']) ?>
+ <?= view('components/select-individual', ['name' => 'indi-xref', 'tree' => $tree]) ?>
</div>
<div class="col-sm-4 col-md-3">
<div class="form-check">
<input class="form-check-input" type="radio" name="type" value="fam" id="fav-fam-<?= e($block_id) ?>">
- <label for="fav-fam-<?= e($block_id) ?>">
+ <label for="fam-xref">
<?= I18N::translate('Family') ?>
</label>
</div>
</div>
<div class="col-sm-8 col-md-9">
- <?= FunctionsEdit::formControlFamily($tree, null, ['id' => 'xref', 'name' => 'fam-xref']) ?>
+ <?= view('components/select-family', ['name' => 'fam-xref', 'tree' => $tree]) ?>
</div>
<div class="col-sm-4 col-md-3">
@@ -90,7 +89,7 @@ use Illuminate\Support\Collection;
</div>
</div>
<div class="col-sm-8 col-md-9">
- <?= FunctionsEdit::formControlMediaObject($tree, null, ['id' => 'xref', 'name' => 'obje-xref']) ?>
+ <?= view('components/select-media', ['name' => 'obje-xref', 'tree' => $tree]) ?>
</div>
<div class="col-sm-4 col-md-3">
@@ -102,7 +101,7 @@ use Illuminate\Support\Collection;
</div>
</div>
<div class="col-sm-8 col-md-9">
- <?= FunctionsEdit::formControlSource($tree, null, ['id' => 'xref', 'name' => 'sour-xref']) ?>
+ <?= view('components/select-source', ['name' => 'sour-xref', 'tree' => $tree]) ?>
</div>
<div class="col-sm-4 col-md-3">
@@ -113,8 +112,8 @@ use Illuminate\Support\Collection;
</label>
</div>
</div>
- <div class="col-sm-8 col-md-">
- <?= FunctionsEdit::formControlRepository($tree, null, ['id' => 'xref', 'name' => 'repo-xref']) ?>
+ <div class="col-sm-8 col-md-9">
+ <?= view('components/select-repository', ['name' => 'repo-xref', 'tree' => $tree]) ?>
</div>
<div class="col-sm-4 col-md-3">
diff --git a/resources/views/modules/gedcom_stats/config.phtml b/resources/views/modules/gedcom_stats/config.phtml
index b330f7bc7a..64e8db48db 100644
--- a/resources/views/modules/gedcom_stats/config.phtml
+++ b/resources/views/modules/gedcom_stats/config.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<fieldset class="form-group">
@@ -7,11 +6,7 @@
<?= I18N::translate('Last change') ?>
</legend>
<div class="col-sm-9">
- <?= Bootstrap4::checkbox(/* I18N: label for yes/no option */
- I18N::translate('Show date of last update'),
- false,
- ['name' => 'show_last_update', 'checked' => (bool) $show_last_update]
- ) ?>
+ <?= view('components/checkbox', ['label' => /* I18N: label for yes/no option */ I18N::translate('Show date of last update'),'name' => 'show_last_update', 'checked' => (bool) $show_last_update]) ?>
</div>
</div>
</fieldset>
@@ -22,22 +17,22 @@
<?= I18N::translate('Statistics') ?>
</legend>
<div class="col-sm-9">
- <?= Bootstrap4::checkbox(I18N::translate('Individuals'), false, ['name' => 'stat_indi', 'checked' => (bool) $stat_indi]) ?>
- <?= Bootstrap4::checkbox(I18N::translate('Total surnames'), false, ['name' => 'stat_surname', 'checked' => (bool) $stat_surname]) ?>
- <?= Bootstrap4::checkbox(I18N::translate('Families'), false, ['name' => 'stat_fam', 'checked' => (bool) $stat_fam]) ?>
- <?= Bootstrap4::checkbox(I18N::translate('Sources'), false, ['name' => 'stat_sour', 'checked' => (bool) $stat_sour]) ?>
- <?= Bootstrap4::checkbox(I18N::translate('Media objects'), false, ['name' => 'stat_media', 'checked' => (bool) $stat_media]) ?>
- <?= Bootstrap4::checkbox(I18N::translate('Repositories'), false, ['name' => 'stat_repo', 'checked' => (bool) $stat_repo]) ?>
- <?= Bootstrap4::checkbox(I18N::translate('Total events'), false, ['name' => 'stat_events', 'checked' => (bool) $stat_events]) ?>
- <?= Bootstrap4::checkbox(I18N::translate('Total users'), false, ['name' => 'stat_users', 'checked' => (bool) $stat_users]) ?>
- <?= Bootstrap4::checkbox(I18N::translate('Earliest birth'), false, ['name' => 'stat_first_birth', 'checked' => (bool) $stat_first_birth]) ?>
- <?= Bootstrap4::checkbox(I18N::translate('Latest birth'), false, ['name' => 'stat_last_birth', 'checked' => (bool) $stat_last_birth]) ?>
- <?= Bootstrap4::checkbox(I18N::translate('Earliest death'), false, ['name' => 'stat_first_death', 'checked' => (bool) $stat_first_death]) ?>
- <?= Bootstrap4::checkbox(I18N::translate('Latest death'), false, ['name' => 'stat_last_death', 'checked' => (bool) $stat_last_death]) ?>
- <?= Bootstrap4::checkbox(I18N::translate('Individual who lived the longest'), false, ['name' => 'stat_long_life', 'checked' => (bool) $stat_long_life]) ?>
- <?= Bootstrap4::checkbox(I18N::translate('Average age at death'), false, ['name' => 'stat_avg_life', 'checked' => (bool) $stat_avg_life]) ?>
- <?= Bootstrap4::checkbox(I18N::translate('Family with the most children'), false, ['name' => 'stat_most_chil', 'checked' => (bool) $stat_most_chil]) ?>
- <?= Bootstrap4::checkbox(I18N::translate('Average number of children per family'), false, ['name' => 'stat_avg_chil', 'checked' => (bool) $stat_avg_chil]) ?>
+ <?= view('components/checkbox', ['label' => I18N::translate('Individuals'), 'name' => 'stat_indi', 'checked' => (bool) $stat_indi]) ?>
+ <?= view('components/checkbox', ['label' => I18N::translate('Total surnames'), 'name' => 'stat_surname', 'checked' => (bool) $stat_surname]) ?>
+ <?= view('components/checkbox', ['label' => I18N::translate('Families'), 'name' => 'stat_fam', 'checked' => (bool) $stat_fam]) ?>
+ <?= view('components/checkbox', ['label' => I18N::translate('Sources'), 'name' => 'stat_sour', 'checked' => (bool) $stat_sour]) ?>
+ <?= view('components/checkbox', ['label' => I18N::translate('Media objects'), 'name' => 'stat_media', 'checked' => (bool) $stat_media]) ?>
+ <?= view('components/checkbox', ['label' => I18N::translate('Repositories'), 'name' => 'stat_repo', 'checked' => (bool) $stat_repo]) ?>
+ <?= view('components/checkbox', ['label' => I18N::translate('Total events'), 'name' => 'stat_events', 'checked' => (bool) $stat_events]) ?>
+ <?= view('components/checkbox', ['label' => I18N::translate('Total users'), 'name' => 'stat_users', 'checked' => (bool) $stat_users]) ?>
+ <?= view('components/checkbox', ['label' => I18N::translate('Earliest birth'), 'name' => 'stat_first_birth', 'checked' => (bool) $stat_first_birth]) ?>
+ <?= view('components/checkbox', ['label' => I18N::translate('Latest birth'), 'name' => 'stat_last_birth', 'checked' => (bool) $stat_last_birth]) ?>
+ <?= view('components/checkbox', ['label' => I18N::translate('Earliest death'), 'name' => 'stat_first_death', 'checked' => (bool) $stat_first_death]) ?>
+ <?= view('components/checkbox', ['label' => I18N::translate('Latest death'), 'name' => 'stat_last_death', 'checked' => (bool) $stat_last_death]) ?>
+ <?= view('components/checkbox', ['label' => I18N::translate('Individual who lived the longest'), 'name' => 'stat_long_life', 'checked' => (bool) $stat_long_life]) ?>
+ <?= view('components/checkbox', ['label' => I18N::translate('Average age at death'), 'name' => 'stat_avg_life', 'checked' => (bool) $stat_avg_life]) ?>
+ <?= view('components/checkbox', ['label' => I18N::translate('Family with the most children'), 'name' => 'stat_most_chil', 'checked' => (bool) $stat_most_chil]) ?>
+ <?= view('components/checkbox', ['label' => I18N::translate('Average number of children per family'), 'name' => 'stat_avg_chil', 'checked' => (bool) $stat_avg_chil]) ?>
</div>
</div>
</fieldset>
@@ -50,7 +45,7 @@
</label>
</legend>
<div class="col-sm-9">
- <?= Bootstrap4::checkbox(I18N::translate('Most common surnames'), false, ['name' => 'show_common_surnames', 'checked' => (bool) $show_common_surnames]) ?>
+ <?= view('components/checkbox', ['label' => I18N::translate('Most common surnames'), 'name' => 'show_common_surnames', 'checked' => (bool) $show_common_surnames]) ?>
<label for="number_of_surnames">
<?= /* I18N: ... to show in a list */
I18N::translate('Number of surnames') ?>
diff --git a/resources/views/modules/hourglass-chart/page.phtml b/resources/views/modules/hourglass-chart/page.phtml
index 133f71c2e5..974cfefc88 100644
--- a/resources/views/modules/hourglass-chart/page.phtml
+++ b/resources/views/modules/hourglass-chart/page.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
@@ -17,7 +16,7 @@
<?= I18N::translate('Individual') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= FunctionsEdit::formControlIndividual($tree, $individual, ['id' => 'xref', 'name' => 'xref']) ?>
+ <?= view('components/select-individual', ['name' => 'xref', 'individual' => $individual, 'tree' => $tree]) ?>
</div>
</div>
@@ -26,7 +25,7 @@
<?= I18N::translate('Generations') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= Bootstrap4::select(FunctionsEdit::numericOptions(range($minimum_generations, $maximum_generations)), $generations, ['id' => 'generations', 'name' => 'generations']) ?>
+ <?= view('components/select', ['name' => 'generations', 'selected' => $generations, 'values' => FunctionsEdit::numericOptions(range($minimum_generations, $maximum_generations))]) ?>
</div>
</div>
@@ -36,7 +35,7 @@
<?= I18N::translate('Layout') ?>
</legend>
<div class="col-sm-9 wt-page-options-value">
- <?= Bootstrap4::checkbox(I18N::translate('Show spouses'), false, ['name' => 'show_spouse', 'checked' => $show_spouse]) ?>
+ <?= view('components/checkbox', ['label' => I18N::translate('Show spouses'), 'name' => 'show_spouse', 'checked' => $show_spouse]) ?>
</div>
</div>
</fieldset>
diff --git a/resources/views/modules/html/config.phtml b/resources/views/modules/html/config.phtml
index a059329d36..da6be6dcb7 100644
--- a/resources/views/modules/html/config.phtml
+++ b/resources/views/modules/html/config.phtml
@@ -1,6 +1,6 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
+<?php use Fisharebest\Webtrees\View; ?>
<div class="row form-group">
<label class="col-sm-3 col-form-label" for="title">
@@ -16,7 +16,7 @@
<?= I18N::translate('Templates') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select([$html => I18N::translate('Custom')] + array_flip($templates), '', ['onchange' => 'this.form.html.value=this.options[this.selectedIndex].value; CKEDITOR.instances.html.setData(document.getElementById("html").value);', 'id' => 'template']) ?>
+ <?= view('components/select', ['name' => '', 'id' => 'template', 'selected' => '', 'values' => $templates]) ?>
<p class="small text-muted">
<?= I18N::translate('To assist you in getting started with this block, we have created several standard templates. When you select one of these templates, the text area will contain a copy that you can then alter to suit your site’s requirements.') ?>
</p>
@@ -41,7 +41,7 @@
<?= I18N::translate('Show the date and time of update') ?>
</legend>
<div class="col-sm-9">
- <?= Bootstrap4::radioButtons('show_timestamp', FunctionsEdit::optionsNoYes(), $show_timestamp, true) ?>
+ <?= view('components/radios-inline', ['name' => 'show_timestamp', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $show_timestamp]) ?>
</div>
</div>
</fieldset>
@@ -56,3 +56,12 @@
</div>
</div>
</fieldset>
+
+<?php View::push('javascript') ?>
+<script>
+ $("#template").change(function () {
+ this.form.html.value=this.options[this.selectedIndex].value;
+ CKEDITOR.instances.html.setData(document.getElementById("html").value);
+ });
+</script>
+<?php View::endpush() ?>
diff --git a/resources/views/modules/lifespans-chart/page.phtml b/resources/views/modules/lifespans-chart/page.phtml
index fad07d8166..96489b58a7 100644
--- a/resources/views/modules/lifespans-chart/page.phtml
+++ b/resources/views/modules/lifespans-chart/page.phtml
@@ -1,5 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<h2 class="wt-page-title">
@@ -21,12 +19,8 @@
<?= I18N::translate('Add individuals') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= FunctionsEdit::formControlIndividual($tree, null, [
- 'id' => 'addxref',
- 'name' => 'addxref',
- ]) ?>
-
- <?= Bootstrap4::checkbox(/* I18N: Label for a configuration option */ I18N::translate('Include the individual’s immediate family'), false, ['name' => 'addfam']) ?>
+ <?= view('components/select-individual', ['name' => 'addxref', 'tree' => $tree]) ?>
+ <?= view('components/checkbox', ['label' => /* I18N: Label for a configuration option */ I18N::translate('Include the individual’s immediate family'), 'name' => 'addfam']) ?>
</div>
</div>
diff --git a/resources/views/modules/pedigree-chart/page.phtml b/resources/views/modules/pedigree-chart/page.phtml
index 4219520536..7b63b8322c 100644
--- a/resources/views/modules/pedigree-chart/page.phtml
+++ b/resources/views/modules/pedigree-chart/page.phtml
@@ -1,5 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<h2 class="wt-page-title">
@@ -17,7 +15,7 @@
<?= I18N::translate('Individual') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= FunctionsEdit::formControlIndividual($tree, $individual, ['id' => 'xref', 'name' => 'xref']) ?>
+ <?= view('components/select-individual', ['name' => 'xref', 'individual' => $individual, 'tree' => $tree]) ?>
</div>
</div>
@@ -26,7 +24,7 @@
<?= I18N::translate('Generations') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= Bootstrap4::select($generation_options, $generations, ['id' => 'generations', 'name' => 'generations']) ?>
+ <?= view('components/select', ['name' => 'generations', 'selected' => $generations, 'values' => $generation_options]) ?>
</div>
</div>
@@ -35,10 +33,7 @@
<?= I18N::translate('Layout') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= view('components/radio-inline', ['name' => 'orientation', 'value' => 'left', 'checked' => $orientation === 'left', 'text' => view('icons/pedigree-left') . I18N::translate('left')]) ?>
- <?= view('components/radio-inline', ['name' => 'orientation', 'value' => 'right', 'checked' => $orientation === 'right', 'text' => view('icons/pedigree-right') . I18N::translate('right')]) ?>
- <?= view('components/radio-inline', ['name' => 'orientation', 'value' => 'up', 'checked' => $orientation === 'up', 'text' => view('icons/pedigree-up') . I18N::translate('up')]) ?>
- <?= view('components/radio-inline', ['name' => 'orientation', 'value' => 'down', 'checked' => $orientation === 'down', 'text' => view('icons/pedigree-down') . I18N::translate('down')]) ?>
+ <?= view('components/radios-inline', ['name' => 'orientation', 'options' => ['left' => view('icons/pedigree-left') . I18N::translate('left'), 'right' => view('icons/pedigree-right') . I18N::translate('right'), 'up' => view('icons/pedigree-up') . I18N::translate('up'), 'down' => view('icons/pedigree-down') . I18N::translate('down'), ], 'selected' => $orientation]) ?>
</div>
</div>
diff --git a/resources/views/modules/pedigree-map/page.phtml b/resources/views/modules/pedigree-map/page.phtml
index d058f17d03..d483cc94f4 100644
--- a/resources/views/modules/pedigree-map/page.phtml
+++ b/resources/views/modules/pedigree-map/page.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
@@ -15,7 +14,7 @@
<?= I18N::translate('Individual') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= FunctionsEdit::formControlIndividual($tree, $individual, ['id' => 'xref', 'name' => 'xref']) ?>
+ <?= view('components/select-individual', ['name' => 'xref', 'individual' => $individual, 'tree' => $tree]) ?>
</div>
</div>
@@ -24,13 +23,7 @@
<?= I18N::translate('Generations') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?=
- Bootstrap4::select(
- FunctionsEdit::numericOptions(range(2, $maxgenerations)),
- $generations,
- ['id' => 'generations', 'name' => 'generations']
- )
-?>
+ <?= view('components/select', ['name' => 'generations', 'selected' => $generations, 'values' => FunctionsEdit::numericOptions(range(2, $maxgenerations))]) ?>
</div>
</div>
diff --git a/resources/views/modules/random_media/config.phtml b/resources/views/modules/random_media/config.phtml
index d7810cc0f6..ff225b7ce2 100644
--- a/resources/views/modules/random_media/config.phtml
+++ b/resources/views/modules/random_media/config.phtml
@@ -1,13 +1,12 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
-<?php use Fisharebest\Webtrees\I18N; ?>
+use Fisharebest\Webtrees\I18N; ?>
+<?php ?>
<div class="form-group row">
<label class="col-sm-3 col-form-label" for="filter">
<?= I18N::translate('Show only individuals, events, or all') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select(['indi' => I18N::translate('Individuals'), 'event' => I18N::translate('Facts and events'), 'all' => I18N::translate('All')], $filter, ['id' => 'filter', 'name' => 'filter']) ?>
+ <?= view('components/select', ['name' => 'filter', 'selected' => $filter, 'values' => ['indi' => I18N::translate('Individuals'), 'event' => I18N::translate('Facts and events'), 'all' => I18N::translate('All')]]) ?>
</div>
</div>
@@ -18,7 +17,7 @@
</legend>
<div class="col-sm-9">
<?php foreach ($formats as $typeName => $typeValue) : ?>
- <?= Bootstrap4::checkbox($typeValue, false, ['name' => 'filter_' . $typeName, 'checked' => (bool) $filters[$typeName]]) ?>
+ <?= view('components/checkbox', ['label' => $typeValue, 'name' => 'filter_' . $typeName, 'checked' => (bool) $filters[$typeName]]) ?>
<?php endforeach ?>
</div>
</div>
@@ -29,7 +28,7 @@
<?= I18N::translate('Show slide show controls') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::radioButtons('controls', FunctionsEdit::optionsNoYes(), $controls, true) ?>
+ <?= view('components/radios-inline', ['name' => 'controls', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $controls]) ?>
</div>
</div>
@@ -38,6 +37,6 @@
<?= I18N::translate('Start slide show on page load') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::radioButtons('start', FunctionsEdit::optionsNoYes(), $start, true) ?>
+ <?= view('components/radios-inline', ['name' => 'start', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $start]) ?>
</div>
</div>
diff --git a/resources/views/modules/recent_changes/config.phtml b/resources/views/modules/recent_changes/config.phtml
index cf44fd55e8..61847458af 100644
--- a/resources/views/modules/recent_changes/config.phtml
+++ b/resources/views/modules/recent_changes/config.phtml
@@ -1,5 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<div class="form-group row">
@@ -17,7 +15,7 @@
<?= I18N::translate('Presentation style') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($info_styles, $infoStyle, ['id' => 'infoStyle', 'name' => 'infoStyle']) ?>
+ <?= view('components/select', ['name' => 'infoStyle', 'selected' => $info_styles, 'values' => $info_styles]) ?>
</div>
</div>
@@ -26,7 +24,7 @@
<?= I18N::translate('Sort order') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($sort_styles, $sortStyle, ['id' => 'sortStyle', 'name' => 'sortStyle']) ?>
+ <?= view('components/select', ['name' => 'sortStyle', 'selected' => $sortStyle, 'options' => $sort_styles]) ?>
</div>
</div>
@@ -35,6 +33,6 @@
<?= /* I18N: label for a yes/no option */ I18N::translate('Show the user who made the change') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::radioButtons('show_user', FunctionsEdit::optionsNoYes(), $show_user, true) ?>
+ <?= view('components/radios-inline', ['name' => 'show_user', 'values' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $show_user]) ?>
</div>
</div>
diff --git a/resources/views/modules/relationships-chart/config.phtml b/resources/views/modules/relationships-chart/config.phtml
index 1b45cb4a09..e6e714a98f 100644
--- a/resources/views/modules/relationships-chart/config.phtml
+++ b/resources/views/modules/relationships-chart/config.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('modules') => I18N::translate('Modules'), $title]]) ?>
@@ -18,7 +17,7 @@
I18N::translate('Relationships') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($ancestors_options, $tree->getPreference('RELATIONSHIP_ANCESTORS', $default_ancestors), ['id' => 'relationship-ancestors-' . $tree->id(), 'name' => 'relationship-ancestors-' . $tree->id()]) ?>
+ <?= view('components/select', ['name' => 'relationship-ancestors-' . $tree->id(), 'selected' => $tree->getPreference('RELATIONSHIP_ANCESTORS', $default_ancestors), 'values' => $ancestors_options]) ?>
</div>
</div>
@@ -29,7 +28,7 @@
I18N::translate('How much recursion to use when searching for relationships') ?>
</legend>
<div class="col-sm-9">
- <?= Bootstrap4::radioButtons('relationship-recursion-' . $tree->id(), $recursion_options, $tree->getPreference('RELATIONSHIP_RECURSION', $default_recursion), true) ?>
+ <?= view('components/radios-inline', ['name' => 'relationship-recursion-' . $tree->id(), 'options' => $recursion_options, 'selected' => $default_recursion]) ?>
</div>
</div>
</fieldset>
diff --git a/resources/views/modules/relationships-chart/page.phtml b/resources/views/modules/relationships-chart/page.phtml
index 7d36a6c18b..07ea530d8d 100644
--- a/resources/views/modules/relationships-chart/page.phtml
+++ b/resources/views/modules/relationships-chart/page.phtml
@@ -1,5 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?php use Fisharebest\Webtrees\View; ?>
@@ -18,10 +16,7 @@
<?= I18N::translate('Individual 1') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= FunctionsEdit::formControlIndividual($tree, $individual1, [
- 'id' => 'xref',
- 'name' => 'xref',
- ]) ?>
+ <?= view('components/select-individual', ['name' => 'xref', 'individual' => $individual1, 'tree' => $tree]) ?>
<button class="btn btn-link small" id="btn-swap-individuals" type="button">
<?= /* I18N: Reverse the order of two individuals */
I18N::translate('Swap individuals') ?>
@@ -34,10 +29,7 @@
<?= I18N::translate('Individual 2') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= FunctionsEdit::formControlIndividual($tree, $individual2, [
- 'id' => 'xref2',
- 'name' => 'xref2',
- ]) ?>
+ <?= view('components/select-individual', ['name' => 'xref2', 'individual' => $individual2, 'tree' => $tree]) ?>
</div>
</div>
@@ -50,7 +42,7 @@
<input type="hidden" name="ancestors" value="1">
<?= I18N::translate('Find relationships via ancestors') ?>
<?php else : ?>
- <?= Bootstrap4::radioButtons('ancestors', $ancestors_options, $ancestors, false) ?>
+ <?= view('components/radios', ['name' => 'ancestors', 'options' => $ancestors_options, 'selected' => $ancestors]) ?>
<?php endif ?>
</div>
</div>
@@ -65,7 +57,7 @@
<?= I18N::translate('Find the closest relationships') ?>
<input type="hidden" name="recursion" value="0">
<?php else : ?>
- <?= Bootstrap4::radioButtons('recursion', $recursion_options, $recursion, false) ?>
+ <?= view('components/radios', ['name' => 'recursion', 'options' => $recursion_options, 'selected' => $recursion]) ?>
<?php endif ?>
</div>
</div>
diff --git a/resources/views/modules/review_changes/config.phtml b/resources/views/modules/review_changes/config.phtml
index 551d7bd112..a92c2360df 100644
--- a/resources/views/modules/review_changes/config.phtml
+++ b/resources/views/modules/review_changes/config.phtml
@@ -1,5 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<p>
@@ -12,7 +10,7 @@
<?= /* I18N: Label for a configuration option */ I18N::translate('Send out reminder emails') ?>
</legend>
<div class="col-sm-9">
- <?= Bootstrap4::radioButtons('sendmail', FunctionsEdit::optionsNoYes(), $sendmail, true) ?>
+ <?= view('components/radios-inline', ['name' => 'sendmail', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $sendmail]) ?>
</div>
</div>
</fieldset>
diff --git a/resources/views/modules/sitemap/config.phtml b/resources/views/modules/sitemap/config.phtml
index cb9a6c1527..964dc00845 100644
--- a/resources/views/modules/sitemap/config.phtml
+++ b/resources/views/modules/sitemap/config.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('modules') => I18N::translate('Modules'), $title]]) ?>
@@ -17,7 +16,7 @@
<?= csrf_field() ?>
<?php foreach ($all_trees as $tree) : ?>
- <?= Bootstrap4::checkbox($tree->title(), false, ['name' => 'sitemap' . $tree->id(), 'checked' => (bool) $tree->getPreference('include_in_sitemap')]) ?>
+ <?= view('components/checkbox', ['label' => $tree->title(), 'name' => 'sitemap' . $tree->id(), 'checked' => (bool) $tree->getPreference('include_in_sitemap')]) ?>
<?php endforeach ?>
<button type="submit" class="btn btn-primary">
diff --git a/resources/views/modules/statistics-chart/custom.phtml b/resources/views/modules/statistics-chart/custom.phtml
index 796495eccb..3db3964850 100644
--- a/resources/views/modules/statistics-chart/custom.phtml
+++ b/resources/views/modules/statistics-chart/custom.phtml
@@ -1,90 +1,16 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
-<?php use Fisharebest\Webtrees\I18N; ?>
+use Fisharebest\Webtrees\I18N;
+use Fisharebest\Webtrees\View;
-<script>
- function statusDisable(sel) {
- var cbox = document.getElementById(sel);
- cbox.checked = false;
- cbox.disabled = true;
- }
-
- function statusEnable(sel) {
- var cbox = document.getElementById(sel);
- cbox.disabled = false;
- }
-
- function statusHide(sel) {
- var box = document.getElementById(sel);
- box.style.display = "none";
- var box_m = document.getElementById(sel + "_m");
- if (box_m) {
- box_m.style.display = "none";
- }
- if (sel === "map_opt") {
- var box_axes = document.getElementById("axes");
- if (box_axes) {
- box_axes.style.display = "";
- }
- var box_zyaxes = document.getElementById("zyaxes");
- if (box_zyaxes) {
- box_zyaxes.style.display = "";
- }
- }
- }
-
- function statusShow(sel) {
- var box = document.getElementById(sel);
- box.style.display = "";
- var box_m = document.getElementById(sel + "_m");
- if (box_m) {
- box_m.style.display = "none";
- }
- if (sel === "map_opt") {
- var box_axes = document.getElementById("axes");
- if (box_axes) {
- box_axes.style.display = "none";
- }
- var box_zyaxes = document.getElementById("zyaxes");
- if (box_zyaxes) {
- box_zyaxes.style.display = "none";
- }
- }
- }
-
- function statusChecked(sel) {
- var cbox = document.getElementById(sel);
- cbox.checked = true;
- }
-
- function statusShowSurname(x) {
- if (x.value === "surname_distribution_chart") {
- document.getElementById("surname_opt").style.display = "";
- } else if (x.value !== "surname_distribution_chart") {
- document.getElementById("surname_opt").style.display = "none";
- }
- }
-
- function loadCustomChart() {
- $("#custom-chart").html("");
- var form = $("#own-stats-form");
- jQuery.get(form.attr("action"), form.serialize())
- .done(function (data) {
- $("#custom-chart").html(data);
- })
- .fail(function (jqXHR, textStatus) {
- // Server error? Show something to get rid of the spinner.
- $("#custom-chart").html(textStatus);
- });
- return false;
- }
-</script>
+?>
+<?php ?>
+<?php ?>
<div class="container pt-3">
<h4 class="border-bottom p-2 mb-4">
<?= I18N::translate('Create your own chart') ?>
</h4>
- <form id="own-stats-form" action="index.php" onsubmit="return loadCustomChart();" class="wt-page-options wt-page-options-statistics">
+ <form id="own-stats-form" action="index.php" class="wt-page-options wt-page-options-statistics">
<input type="hidden" name="route" value="module">
<input type="hidden" name="module" value="<?= e($module->name()) ?>">
<input type="hidden" name="action" value="CustomChart">
@@ -98,31 +24,37 @@
<fieldset>
<legend><?= I18N::translate('Individual') ?></legend>
- <?= Bootstrap4::radioButtons('x-as', [$module::X_AXIS_BIRTH_MONTH => I18N::translate('Month of birth')], $module::X_AXIS_BIRTH_MONTH, false, ['onchange' => 'statusEnable("z_sex"); statusHide("x_years");; statusHide("map_opt");']) ?>
- <?= Bootstrap4::radioButtons('x-as', [$module::X_AXIS_DEATH_MONTH => I18N::translate('Month of death')], '', false, ['onchange' => 'statusEnable("z_sex"); statusHide("x_years");; statusHide("map_opt");']) ?>
- <?= Bootstrap4::radioButtons('x-as', [$module::X_AXIS_FIRST_CHILD_MONTH => I18N::translate('Month of birth of first child in a relation')], '', false, ['onchange' => 'statusEnable("z_sex"); statusHide("x_years");; statusHide("map_opt");']) ?>
- <?= Bootstrap4::radioButtons('x-as', [$module::X_AXIS_AGE_AT_DEATH => I18N::translate('Average age at death')], '', false, ['onchange' => 'statusEnable("z_sex"); statusShow("x_years");; statusHide("map_opt");']) ?>
- <?= Bootstrap4::radioButtons('x-as', [$module::X_AXIS_AGE_AT_MARRIAGE => I18N::translate('Age in year of marriage')], '', false, ['onchange' => 'statusEnable("z_sex"); statusHide("x_years"); statusShow("x_years_m");; statusHide("map_opt");']) ?>
- <?= Bootstrap4::radioButtons('x-as', [$module::X_AXIS_AGE_AT_FIRST_MARRIAGE => I18N::translate('Age in year of first marriage')], '', false, ['onchange' => 'statusEnable("z_sex"); statusHide("x_years"); statusShow("x_years_m");; statusHide("map_opt");']) ?>
+ <?= view('components/radios', ['name' => 'x-as', 'selected' => $module::X_AXIS_BIRTH_MONTH, 'options' => [
+ $module::X_AXIS_BIRTH_MONTH => I18N::translate('Month of birth'),
+ $module::X_AXIS_DEATH_MONTH => I18N::translate('Month of death'),
+ $module::X_AXIS_FIRST_CHILD_MONTH => I18N::translate('Month of birth of first child in a relation'),
+ $module::X_AXIS_AGE_AT_DEATH => I18N::translate('Average age at death'),
+ $module::X_AXIS_AGE_AT_MARRIAGE => I18N::translate('Age in year of marriage'),
+ $module::X_AXIS_AGE_AT_FIRST_MARRIAGE => I18N::translate('Age in year of first marriage'),
+
+ ]]) ?>
</fieldset>
<fieldset>
<legend><?= I18N::translate('Family') ?></legend>
- <?= Bootstrap4::radioButtons('x-as', [
+ <?= view('components/radios', ['name' => 'x-as', 'selected' => $module::X_AXIS_BIRTH_MONTH, 'options' => [
$module::X_AXIS_MARRIAGE_MONTH => I18N::translate('Month of marriage'),
$module::X_AXIS_FIRST_MARRIAGE_MONTH => I18N::translate('Month of first marriage'),
- ], '', false, ['onchange' => 'statusChecked("z_none"); statusDisable("z_sex"); statusHide("x_years");; statusHide("map_opt");']) ?>
- <?= Bootstrap4::radioButtons('x-as', [$module::X_AXIS_NUMBER_OF_CHILDREN => I18N::translate('Number of children')], '', false, ['onchange' => 'statusChecked("z_none"); statusDisable("z_sex"); statusHide("x_years");; statusHide("map_opt");']) ?>
+ $module::X_AXIS_NUMBER_OF_CHILDREN => I18N::translate('Number of children'),
+
+ ]]) ?>
</fieldset>
<fieldset>
<legend><?= I18N::translate('Map') ?></legend>
- <?= Bootstrap4::radioButtons('x-as', [$module::X_AXIS_INDIVIDUAL_MAP => I18N::translate('Individuals')], '', false, ['onchange' => 'statusHide("x_years");; statusShow("map_opt"); statusShow("chart_type");']) ?>
- <?= Bootstrap4::radioButtons('x-as', [$module::X_AXIS_BIRTH_MAP => I18N::translate('Births')], '', false, ['onchange' => 'statusHide("x_years");; statusShow("map_opt"); statusHide("chart_type"); statusHide("surname_opt");']) ?>
- <?= Bootstrap4::radioButtons('x-as', [$module::X_AXIS_MARRIAGE_MAP => I18N::translate('Marriages')], '', false, ['onchange' => 'statusHide("x_years");; statusShow("map_opt"); statusHide("chart_type"); statusHide("surname_opt");']) ?>
- <?= Bootstrap4::radioButtons('x-as', [$module::X_AXIS_DEATH_MAP => I18N::translate('Deaths')], '', false, ['onchange' => 'statusHide("x_years");; statusShow("map_opt"); statusHide("chart_type"); statusHide("surname_opt");']) ?>
+ <?= view('components/radios', ['name' => 'x-as', 'selected' => $module::X_AXIS_BIRTH_MONTH, 'options' => [
+ $module::X_AXIS_INDIVIDUAL_MAP => I18N::translate('Individuals'),
+ $module::X_AXIS_BIRTH_MAP => I18N::translate('Births'),
+ $module::X_AXIS_MARRIAGE_MAP => I18N::translate('Marriages'),
+ $module::X_AXIS_DEATH_MAP => I18N::translate('Deaths'),
+ ]]) ?>
</fieldset>
</div>
@@ -194,14 +126,7 @@
<label for="x-axis-boundaries-ages" class="sr-only">
<?= I18N::translate('Age interval') ?>
</label>
- <?= Bootstrap4::select([
- '1,5,10,20,30,40,50,60,70,80,90,100' => I18N::plural('%s year', '%s years', 10, I18N::number(10)),
- '5,20,40,60,75,80,85,90' => I18N::plural('%s year', '%s years', 20, I18N::number(20)),
- '10,25,50,75,100' => I18N::plural('%s year', '%s years', 25, I18N::number(25)),
- ], '1,5,10,20,30,40,50,60,70,80,90,100', [
- 'id' => 'x-axis-boundaries-ages',
- 'name' => 'x-axis-boundaries-ages',
- ]) ?>
+ <?= view('components/select', ['name' => 'x-axis-boundaries-ages', 'selected' => '1,5,10,20,30,40,50,60,70,80,90,100', 'values' => ['1,5,10,20,30,40,50,60,70,80,90,100' => I18N::plural('%s year', '%s years', 10, I18N::number(10)), '5,20,40,60,75,80,85,90' => I18N::plural('%s year', '%s years', 20, I18N::number(20)), '10,25,50,75,100' => I18N::plural('%s year', '%s years', 25, I18N::number(25))]]) ?>
</fieldset>
<fieldset id="x_years_m" style="display:none;">
@@ -210,13 +135,7 @@
<label for="x-axis-boundaries-ages_m" class="sr-only">
<?= I18N::translate('Select the desired age interval') ?>
</label>
- <?= Bootstrap4::select([
- '16,18,20,22,24,26,28,30,32,35,40,50' => I18N::plural('%s year', '%s years', 2, I18N::number(2)),
- '20,25,30,35,40,45,50' => I18N::plural('%s year', '%s years', 5, I18N::number(5)),
- ], '16,18,20,22,24,26,28,30,32,35,40,50', [
- 'id' => 'x-axis-boundaries-ages_m',
- 'name' => 'x-axis-boundaries-ages_m',
- ]) ?>
+ <?= view('components/select', ['name' => 'x-axis-boundaries-ages_m', 'selected' => '16,18,20,22,24,26,28,30,32,35,40,50', 'values' => ['16,18,20,22,24,26,28,30,32,35,40,50' => I18N::plural('%s year', '%s years', 2, I18N::number(2)), '20,25,30,35,40,45,50' => I18N::plural('%s year', '%s years', 5, I18N::number(5))]]) ?>
</fieldset>
<div id="map_opt" style="display:none;">
@@ -283,3 +202,135 @@
<!-- Not initially empty, to disable spinner -->
</div>
</div>
+
+<?php View::push('javascript') ?>
+<script>
+ function statusDisable(sel) {
+ var cbox = document.getElementById(sel);
+ cbox.checked = false;
+ cbox.disabled = true;
+ }
+
+ function statusEnable(sel) {
+ var cbox = document.getElementById(sel);
+ cbox.disabled = false;
+ }
+
+ function statusHide(sel) {
+ var box = document.getElementById(sel);
+ box.style.display = "none";
+ var box_m = document.getElementById(sel + "_m");
+ if (box_m) {
+ box_m.style.display = "none";
+ }
+ if (sel === "map_opt") {
+ var box_axes = document.getElementById("axes");
+ if (box_axes) {
+ box_axes.style.display = "";
+ }
+ var box_zyaxes = document.getElementById("zyaxes");
+ if (box_zyaxes) {
+ box_zyaxes.style.display = "";
+ }
+ }
+ }
+
+ function statusShow(sel) {
+ var box = document.getElementById(sel);
+ box.style.display = "";
+ var box_m = document.getElementById(sel + "_m");
+ if (box_m) {
+ box_m.style.display = "none";
+ }
+ if (sel === "map_opt") {
+ var box_axes = document.getElementById("axes");
+ if (box_axes) {
+ box_axes.style.display = "none";
+ }
+ var box_zyaxes = document.getElementById("zyaxes");
+ if (box_zyaxes) {
+ box_zyaxes.style.display = "none";
+ }
+ }
+ }
+
+ function statusChecked(sel) {
+ var cbox = document.getElementById(sel);
+ cbox.checked = true;
+ }
+
+ function statusShowSurname(x) {
+ if (x.value === "surname_distribution_chart") {
+ document.getElementById("surname_opt").style.display = "";
+ } else if (x.value !== "surname_distribution_chart") {
+ document.getElementById("surname_opt").style.display = "none";
+ }
+ }
+
+ function loadCustomChart() {
+ $("#custom-chart").html("");
+ var form = $("#own-stats-form");
+ jQuery.get(form.attr("action"), form.serialize())
+ .done(function (data) {
+ $("#custom-chart").html(data);
+ })
+ .fail(function (jqXHR, textStatus) {
+ // Server error? Show something to get rid of the spinner.
+ $("#custom-chart").html(textStatus);
+ });
+ return false;
+ }
+
+ $("[name='x-as']").change(function() {
+ var x_axis = document.querySelector("[name='x-as']:checked").value;
+
+ switch (x_axis) {
+ case "<?= e($module::X_AXIS_BIRTH_MONTH) ?>":
+ case "<?= e($module::X_AXIS_DEATH_MONTH) ?>":
+ case "<?= e($module::X_AXIS_FIRST_CHILD_MONTH) ?>":
+ statusEnable("z_sex");
+ statusHide("x_years");
+ statusHide("map_opt");
+ break;
+
+ case "<?= e($module::X_AXIS_AGE_AT_DEATH) ?>":
+ statusEnable("z_sex");
+ statusShow("x_years");
+ statusHide("map_opt");
+ break;
+
+ case "<?= e($module::X_AXIS_AGE_AT_MARRIAGE) ?>":
+ case "<?= e($module::X_AXIS_AGE_AT_FIRST_MARRIAGE) ?>":
+ statusEnable("z_sex");
+ statusHide("x_years");
+ statusShow("x_years_m");
+ statusHide("map_opt");
+ break;
+
+ case "<?= e($module::X_AXIS_MARRIAGE_MONTH) ?>":
+ case "<?= e($module::X_AXIS_FIRST_MARRIAGE_MONTH) ?>":
+ statusChecked("z_none");
+ statusDisable("z_sex");
+ statusHide("x_years");
+ statusHide("map_opt");
+ break;
+
+ case "<?= e($module::X_AXIS_INDIVIDUAL_MAP) ?>":
+ statusHide("x_years");
+ statusShow("map_opt");
+ statusShow("chart_type");
+ break;
+
+ case "<?= e($module::X_AXIS_BIRTH_MAP) ?>":
+ case "<?= e($module::X_AXIS_MARRIAGE_MAP) ?>":
+ case "<?= e($module::X_AXIS_DEATH_MAP) ?>":
+ statusHide("x_years"); statusShow("map_opt");
+ statusHide("chart_type");
+ statusHide("surname_opt");
+ break;
+ }
+ });
+
+ $("#own-stats-form").on("submit", loadCustomChart);
+</script>
+<?php View::endpush() ?>
diff --git a/resources/views/modules/stories/config.phtml b/resources/views/modules/stories/config.phtml
index 37b155d8c9..d0296f5dcf 100644
--- a/resources/views/modules/stories/config.phtml
+++ b/resources/views/modules/stories/config.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), route('modules') => I18N::translate('Modules'), $title]]) ?>
@@ -14,7 +13,7 @@
<?= I18N::translate('Family tree') ?>
</label>
- <?= Bootstrap4::select($tree_names, $tree->name(), ['id' => 'ged', 'name' => 'ged']) ?>
+ <?= view('components/select', ['name' => 'ged', 'selected' => $tree->name(), 'values' => $tree_names]) ?>
<button type="submit" class="btn btn-primary">
<?= I18N::translate('show') ?>
</button>
diff --git a/resources/views/modules/stories/edit.phtml b/resources/views/modules/stories/edit.phtml
index 7d6282e5cd..c1190c9530 100644
--- a/resources/views/modules/stories/edit.phtml
+++ b/resources/views/modules/stories/edit.phtml
@@ -13,7 +13,7 @@
<?= I18N::translate('Individual') ?>
</label>
<div class="col-sm-9">
- <?= FunctionsEdit::formControlIndividual($tree, $individual, ['id' => 'xref', 'name' => 'xref']) ?>
+ <?= view('components/select-individual', ['name' => 'xref', 'individual' => $individual, 'tree' => $tree]) ?>
</div>
</div>
diff --git a/resources/views/modules/stories/list.phtml b/resources/views/modules/stories/list.phtml
index e159aa9626..4c6df94366 100644
--- a/resources/views/modules/stories/list.phtml
+++ b/resources/views/modules/stories/list.phtml
@@ -1,9 +1,8 @@
<?php use Fisharebest\Webtrees\I18N; ?>
-<?php use Fisharebest\Webtrees\View; ?>
<h2 class="wt-page-title"><?= $title ?></h2>
-<table id="story_table" class="w-100">
+<table class="table table-bordered w-100">
<thead>
<tr>
<th><?= I18N::translate('Story title') ?></th>
@@ -25,24 +24,3 @@
<?php endforeach ?>
</tbody>
</table>
-
-<?php View::push('javascript') ?>
-<script>
- $("#story_table").dataTable({
- dom: '<"H"pf<"dt-clear">irl>t<"F"pl>',
- autoWidth: false,
- paging: true,
- pagingType: "full_numbers",
- lengthChange: true,
- filter: true,
- info: true,
- sorting: [[0,"asc"]],
- columns: [
- /* 0-name */ null,
- /* 1-NAME */ null
- ],
- <?= I18N::datatablesI18N() ?>
- });
-
-</script>
-<?php View::endpush() ?>
diff --git a/resources/views/modules/timeline-chart/page.phtml b/resources/views/modules/timeline-chart/page.phtml
index c440e71288..5f3c65c03a 100644
--- a/resources/views/modules/timeline-chart/page.phtml
+++ b/resources/views/modules/timeline-chart/page.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<h2 class="wt-page-title">
@@ -21,10 +20,7 @@
<?= I18N::translate('Individual') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= FunctionsEdit::formControlIndividual($tree, null, [
- 'id' => 'xref-add',
- 'name' => 'xrefs[]',
- ]) ?>
+ <?= view('components/select-individual', ['name' => 'xrefs[]', 'id' => 'xref-add', 'tree' => $tree]) ?>
</div>
</div>
diff --git a/resources/views/modules/todays_events/config.phtml b/resources/views/modules/todays_events/config.phtml
index 4d408aee70..d680697f01 100644
--- a/resources/views/modules/todays_events/config.phtml
+++ b/resources/views/modules/todays_events/config.phtml
@@ -1,5 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<div class="form-group row">
@@ -7,7 +5,7 @@
<?= I18N::translate('Show only events of living individuals') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::radioButtons('filter', FunctionsEdit::optionsNoYes(), $filter, true) ?>
+ <?= view('components/radios-inline', ['name' => 'filter', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $filter]) ?>
</div>
</div>
@@ -16,7 +14,7 @@
<?= I18N::translate('Events') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::multiSelect($all_events, $event_array, ['id' => 'events', 'name' => 'events[]', 'class' => 'select2']) ?>
+ <?= view('components/select', ['name' => 'events[]', 'id' => 'events', 'selected' => $event_array, 'values' => $all_events, 'class' => 'select2']) ?>
</div>
</div>
@@ -25,7 +23,7 @@
<?= /* I18N: Label for a configuration option */ I18N::translate('Presentation style') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($info_styles, $infoStyle, ['id' => 'infoStyle', 'name' => 'infoStyle']) ?>
+ <?= view('components/select', ['name' => 'infoStyle', 'selected' => $infoStyle, 'values' => $info_styles]) ?>
</div>
</div>
@@ -34,6 +32,6 @@
<?= /* I18N: Label for a configuration option */ I18N::translate('Sort order') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($sort_styles, $sortStyle, ['id' => 'sortStyle', 'name' => 'sortStyle']) ?>
+ <?= view('components/select', ['name' => 'sortStyle', 'selected' => $sortStyle, 'values' => $sort_styles]) ?>
</div>
</div>
diff --git a/resources/views/modules/todo/config.phtml b/resources/views/modules/todo/config.phtml
index 610fe6b5ef..a1a0dc1053 100644
--- a/resources/views/modules/todo/config.phtml
+++ b/resources/views/modules/todo/config.phtml
@@ -1,5 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<p>
@@ -13,7 +11,7 @@
<?= I18N::translate('Show research tasks that are assigned to other users') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::radioButtons('show_other', FunctionsEdit::optionsNoYes(), $show_other, true) ?>
+ <?= view('components/radios-inline', ['name' => 'show_other', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $show_other]) ?>
</div>
</div>
@@ -23,7 +21,7 @@
<?= I18N::translate('Show research tasks that are not assigned to any user') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::radioButtons('show_unassigned', FunctionsEdit::optionsNoYes(), $show_unassigned, true) ?>
+ <?= view('components/radios-inline', ['name' => 'show_unasigned', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $show_unassigned]) ?>
</div>
</div>
@@ -32,6 +30,6 @@
<?= I18N::translate('Show research tasks that have a date in the future') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::radioButtons('show_future', FunctionsEdit::optionsNoYes(), $show_future, true) ?>
+ <?= view('components/radios-inline', ['name' => 'show_future', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $show_future]) ?>
</div>
</div>
diff --git a/resources/views/modules/top10_givnnames/config.phtml b/resources/views/modules/top10_givnnames/config.phtml
index 78fa6ab645..c25e31b628 100644
--- a/resources/views/modules/top10_givnnames/config.phtml
+++ b/resources/views/modules/top10_givnnames/config.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<div class="form-group row">
@@ -15,6 +14,6 @@
<?= I18N::translate('Presentation style') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($info_styles, $infoStyle, ['id' => 'infoStyle', 'name' => 'infoStyle']) ?>
+ <?= view('components/select', ['name' => 'infoStyle', 'selected' => $info_styles, 'values' => $info_styles]) ?>
</div>
</div>
diff --git a/resources/views/modules/top10_pageviews/config.phtml b/resources/views/modules/top10_pageviews/config.phtml
index b1b166f0e3..595de5a2f3 100644
--- a/resources/views/modules/top10_pageviews/config.phtml
+++ b/resources/views/modules/top10_pageviews/config.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<div class="form-group row">
@@ -15,6 +14,6 @@
<?= /* I18N: Label for a configuration option */ I18N::translate('Show counts before or after name') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($options, $count_placement, ['id' => 'count_placement', 'name' => 'count_placement']) ?>
+ <?= view('components/select', ['name' => 'count_placement', 'selected' => $count_placement, 'values' => $options]) ?>
</div>
</div>
diff --git a/resources/views/modules/top10_surnames/config.phtml b/resources/views/modules/top10_surnames/config.phtml
index 727460c3c2..0cdd3190a4 100644
--- a/resources/views/modules/top10_surnames/config.phtml
+++ b/resources/views/modules/top10_surnames/config.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<div class="form-group row">
@@ -15,6 +14,6 @@
<?= I18N::translate('Presentation style') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($info_styles, $infoStyle, ['id' => 'infoStyle', 'name' => 'infoStyle']) ?>
+ <?= view('components/select', ['name' => 'infoStyle', 'selected' => $infoStyle, 'values' => $info_styles]) ?>
</div>
</div>
diff --git a/resources/views/modules/upcoming_events/config.phtml b/resources/views/modules/upcoming_events/config.phtml
index e5c8226671..efbb245e75 100644
--- a/resources/views/modules/upcoming_events/config.phtml
+++ b/resources/views/modules/upcoming_events/config.phtml
@@ -1,5 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
-<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<div class="form-group row">
@@ -17,7 +15,7 @@
<?= I18N::translate('Show only events of living individuals') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::radioButtons('filter', FunctionsEdit::optionsNoYes(), $filter, true) ?>
+ <?= view('components/radios-inline', ['name' => 'filter', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $filter]) ?>
</div>
</div>
@@ -26,7 +24,7 @@
<?= I18N::translate('Events') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::multiSelect($all_events, $event_array, ['id' => 'events', 'name' => 'events[]', 'class' => 'select2']) ?>
+ <?= view('components/select', ['name' => 'events[]', 'id' => 'events', 'selected' => $event_array, 'values' => $all_events, 'class' => 'select2']) ?>
</div>
</div>
@@ -35,7 +33,7 @@
<?= /* I18N: Label for a configuration option */ I18N::translate('Presentation style') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($info_styles, $infoStyle, ['id' => 'infoStyle', 'name' => 'infoStyle']) ?>
+ <?= view('components/select', ['name' => 'infoStyle', 'selected' => $info_styles, 'values' => $info_styles]) ?>
</div>
</div>
@@ -44,6 +42,6 @@
<?= /* I18N: Label for a configuration option */ I18N::translate('Sort order') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($sort_styles, $sortStyle, ['id' => 'sortStyle', 'name' => 'sortStyle']) ?>
+ <?= view('components/select', ['name' => 'sortStyle', 'selected' => $sortStyle, 'values' => $sort_styles]) ?>
</div>
</div>
diff --git a/resources/views/modules/yahrzeit/config.phtml b/resources/views/modules/yahrzeit/config.phtml
index 6e8657af13..25ae5e693b 100644
--- a/resources/views/modules/yahrzeit/config.phtml
+++ b/resources/views/modules/yahrzeit/config.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<div class="form-group row">
@@ -18,7 +17,7 @@
<?= I18N::translate('Presentation style') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($styles, $infoStyle, ['id' => 'infoStyle', 'name' => 'infoStyle']) ?>
+ <?= view('components/select', ['name' => 'infoStyle', 'selected' => $infoStyle, 'values' => $styles]) ?>
</div>
</div>
@@ -27,6 +26,6 @@
<?= I18N::translate('Calendar') ?>
</label>
<div class="col-sm-9">
- <?= Bootstrap4::select($calendars, $calendar, ['id' => 'calendar', 'name' => 'calendar']) ?>
+ <?= view('components/select', ['name' => 'calendar', 'selected' => $calendar, 'values' => $calendars]) ?>
</div>
</div>
diff --git a/resources/views/search-advanced-field.phtml b/resources/views/search-advanced-field.phtml
index 1b749510a4..3e8a397c6b 100644
--- a/resources/views/search-advanced-field.phtml
+++ b/resources/views/search-advanced-field.phtml
@@ -1,6 +1,5 @@
<?php
-use Fisharebest\Webtrees\Bootstrap4;
use Fisharebest\Webtrees\GedcomTag;
/**
@@ -24,11 +23,11 @@ use Fisharebest\Webtrees\GedcomTag;
<div class="col-sm-3 wt-page-options-value">
<?php if (preg_match('/(GIVN|SURN)$/', $field_name)) : ?>
- <?= Bootstrap4::select($name_options, $modifier, ['name' => 'modifiers[' . $field_name . ']']) ?>
+ <?= view('components/select', ['name' => 'modifiers[' . $field_name . ']', 'id' => 'modifiers-' . $field_name, 'selected' => $modifier, 'values' => $name_options]) ?>
<?php endif ?>
<?php if (preg_match('/(DATE)$/', $field_name)) : ?>
- <?= Bootstrap4::select($date_options, $modifier, ['name' => 'modifiers[' . $field_name . ']']) ?>
+ <?= view('components/select', ['name' => 'modifiers[' . $field_name . ']', 'id' => 'modifiers-' . $field_name, 'selected' => $modifier, 'values' => $date_options]) ?>
<?php endif ?>
</div>
</div>
diff --git a/resources/views/search-advanced-page.phtml b/resources/views/search-advanced-page.phtml
index a5ecba68da..bd296b2ce0 100644
--- a/resources/views/search-advanced-page.phtml
+++ b/resources/views/search-advanced-page.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<h2 class="wt-page-title">
@@ -28,7 +27,7 @@
</div>
<div class="col-sm-3 wt-page-options-value">
- <?= Bootstrap4::select(['' => ''] + $other_fields, '', ['name' => 'other_field']) ?>
+ <?= view('components/select', ['name' => 'other_field', 'selected' => '', 'values' => ['' => ''] + $other_fields]) ?>
</div>
<div class="col-sm-3 wt-page-options-value">
diff --git a/resources/views/search-replace-page.phtml b/resources/views/search-replace-page.phtml
index 575ece5c01..af61689ba2 100644
--- a/resources/views/search-replace-page.phtml
+++ b/resources/views/search-replace-page.phtml
@@ -1,4 +1,3 @@
-<?php use Fisharebest\Webtrees\Bootstrap4; ?>
<?php use Fisharebest\Webtrees\I18N; ?>
<h2 class="wt-page-title">
@@ -31,7 +30,7 @@
<?= /* I18N: A button label. */ I18N::translate('Search') ?>
</label>
<div class="col-sm-9 wt-page-options-value">
- <?= Bootstrap4::radioButtons('context', ['all' => I18N::translate('Entire record'), 'name' => I18N::translate('Names'), 'place' => I18N::translate('Places')], $context, false) ?>
+ <?= view('components/radios-inline', ['name' => 'context', 'options' => ['all' => I18N::translate('Entire record'), 'name' => I18N::translate('Names'), 'place' => I18N::translate('Places')], 'selected' => $context]) ?>
</div>
</div>
<div class="row form-group">