xref: /webtrees/resources/views/admin/trees-preferences.phtml (revision ac71572d8462e396ed5a307f05b29381e49f9e6e)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Auth;
6use Fisharebest\Webtrees\Contracts\UserInterface;
7use Fisharebest\Webtrees\Date;
8use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
9use Fisharebest\Webtrees\Http\RequestHandlers\ManageTrees;
10use Fisharebest\Webtrees\Http\RequestHandlers\TreePreferencesAction;
11use Fisharebest\Webtrees\I18N;
12use Fisharebest\Webtrees\Individual;
13use Fisharebest\Webtrees\Registry;
14use Fisharebest\Webtrees\Tree;
15use Illuminate\Support\Collection;
16
17/**
18 * @var array<string,string>          $all_family_facts
19 * @var array<string,string>          $all_individual_facts
20 * @var array<string,string>          $all_surname_traditions
21 * @var array<int,string>             $calendar_formats
22 * @var string                        $data_folder
23 * @var array<int,string>             $formats
24 * @var Date                          $french_calendar_end
25 * @var Date                          $french_calendar_start
26 * @var Date                          $gregorian_calendar_start
27 * @var Collection<int,UserInterface> $members
28 * @var Individual|null               $pedigree_individual
29 * @var array<int,string>             $privacy_options
30 * @var array<int,string>             $relatives_events
31 * @var array<int,string>             $source_types
32 * @var array<string,string>          $surname_list_styles
33 * @var string                        $title
34 * @var Tree                          $tree
35 * @var int                       $tree_count
36 */
37
38?>
39
40<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), route(ManageTrees::class, ['tree' => $tree->name()]) => I18N::translate('Manage family trees'), $title]]) ?>
41
42<h1><?= $title ?></h1>
43
44<form method="post" action="<?= e(route(TreePreferencesAction::class, ['tree' => $tree->name()])) ?>" class="form-horizontal">
45    <h2><?= I18N::translate('General') ?></h2>
46
47    <!-- TREE TITLE -->
48    <div class="row mb-3">
49        <label class="col-sm-3 col-form-label" for="title">
50            <?= I18N::translate('Family tree title') ?>
51        </label>
52        <div class="col-sm-9">
53            <input
54                class="form-control"
55                dir="auto"
56                id="title"
57                maxlength="255"
58                name="title"
59                required
60                type="text"
61                value="<?= e($tree->getPreference('title')) ?>"
62            >
63        </div>
64    </div>
65
66    <!-- TREE URL / FILENAME -->
67    <?php if (Auth::isAdmin()) : ?>
68        <div class="row mb-3">
69            <label class="col-sm-3 col-form-label" for="gedcom">
70                <?= I18N::translate('URL') ?>
71            </label>
72            <div class="col-sm-9">
73                <div class="input-group" dir="ltr">
74                    <span class="input-group-text" dir="ltr">
75                        <?= e(explode('{tree}', rawurldecode(route('example')))[0]) ?>
76                    </span>
77
78                    <input class="form-control" dir="ltr" id="gedcom" maxlength="255" name="gedcom" required="required" type="text" value="<?= e($tree->name()) ?>">
79
80                    <span class="input-group-text" dir="ltr">
81                        <?= e(explode('{tree}', rawurldecode(route('example')))[1]) ?>
82                    </span>
83                </div>
84
85                <div class="form-text">
86                    <?= /* I18N: help text for family tree / GEDCOM file names */ I18N::translate('Avoid spaces and punctuation. A family name might be a good choice.') ?>
87                </div>
88            </div>
89        </div>
90    <?php endif ?>
91
92    <!-- PEDIGREE_ROOT_ID -->
93    <div class="row mb-3">
94        <label class="col-sm-3 col-form-label" for="PEDIGREE_ROOT_ID">
95            <?= /* I18N: A configuration setting */ I18N::translate('Default individual') ?>
96        </label>
97        <div class="col-sm-9">
98            <?= view('components/select-individual', ['name' => 'PEDIGREE_ROOT_ID', 'individual' => $pedigree_individual, 'tree' => $tree]) ?>
99            <div class="form-text">
100                <?= /* I18N: Help text for the “Default individual” configuration setting */ I18N::translate('This individual will be selected by default when viewing charts and reports.') ?>
101            </div>
102        </div>
103    </div>
104
105    <!-- CALENDAR_FORMAT -->
106    <fieldset class="row mb-3">
107        <legend class="col-form-label col-sm-3">
108            <?= /* I18N: A configuration setting */ I18N::translate('Calendar conversion') ?>
109            <label class="visually-hidden" for="CALENDAR_FORMAT0">
110                <?= /* I18N: A configuration setting */ I18N::translate('Calendar conversion') ?> 1
111            </label>
112            <label class="visually-hidden" for="CALENDAR_FORMAT1">
113                <?= /* I18N: A configuration setting */ I18N::translate('Calendar conversion') ?> 2
114            </label>
115        </legend>
116        <div class="col-sm-9">
117            <div class="row">
118                <div class="col-sm-6">
119                    <?= view('components/select', ['name' => 'CALENDAR_FORMAT0', 'selected' => $calendar_formats[0], 'options' => ['none' => I18N::translate('No calendar conversion')] + Registry::calendarDateFactory()->supportedCalendars()]) ?>
120                </div>
121                <div class="col-sm-6">
122                    <?= view('components/select', ['name' => 'CALENDAR_FORMAT1', 'selected' => $calendar_formats[1], 'options' => ['none' => I18N::translate('No calendar conversion')] + Registry::calendarDateFactory()->supportedCalendars()]) ?>
123                </div>
124            </div>
125            <div class="form-text">
126                <?= /* I18N: Help text for the “Calendar conversion” configuration setting */ I18N::translate('Different calendar systems are used in different parts of the world, and many other calendar systems have been used in the past. Where possible, you should enter dates using the calendar in which the event was originally recorded. You can then specify a conversion, to show these dates in a more familiar calendar. If you regularly use two calendars, you can specify two conversions and dates will be converted to both the selected calendars.') ?>
127            </div>
128            <div class="form-text">
129                <?= /* I18N: Help text for the “Calendar conversion” configuration setting */ I18N::translate('Dates are only converted if they are valid for the calendar. For example, only dates between %1$s and %2$s will be converted to the French calendar and only dates after %3$s will be converted to the Gregorian calendar.', $french_calendar_start->display(), $french_calendar_end->display(), $gregorian_calendar_start->display()) ?>
130            </div>
131            <div class="form-text">
132                <?= /* I18N: Help text for the “Calendar conversion” configuration setting */ I18N::translate('In some calendars, days start at midnight. In other calendars, days start at sunset. The conversion process does not take account of the time, so for any event that occurs between sunset and midnight, the conversion between these types of calendar will be one day out.') ?>
133            </div>
134        </div>
135    </fieldset>
136
137    <!-- GENERATE_UIDS -->
138    <fieldset class="row mb-3">
139        <legend class="col-form-label col-sm-3">
140            <?= /* I18N: A configuration setting */ I18N::translate('Add unique identifiers') ?>
141        </legend>
142        <div class="col-sm-9">
143            <?= view('components/radios-inline', ['name' => 'GENERATE_UIDS', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $tree->getPreference('GENERATE_UIDS')]) ?>
144            <div class="form-text">
145                <?= /* 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.') ?>
146            </div>
147        </div>
148    </fieldset>
149
150    <h2><?= I18N::translate('Contact information') ?></h2>
151
152    <!-- CONTACT_USER_ID -->
153    <div class="row mb-3">
154        <label class="col-sm-3 col-form-label" for="CONTACT_USER_ID">
155            <?= /* I18N: A configuration setting */ I18N::translate('Genealogy contact') ?>
156        </label>
157        <div class="col-sm-9">
158            <select id="CONTACT_USER_ID" name="CONTACT_USER_ID" class="form-select">
159                <option value="">&nbsp;</option>
160                <?php foreach ($members as $member) : ?>
161                    <option value="<?= $member->id() ?>" <?= (int) $tree->getPreference('CONTACT_USER_ID') === $member->id() ? 'selected' : '' ?>>
162                        <?= e($member->realName()) ?> - <?= e($member->userName()) ?>
163                    </option>
164                <?php endforeach ?>
165            </select>
166            <div class="form-text">
167                <?= /* I18N: Help text for the “Genealogy contact” configuration setting */ I18N::translate('The individual to contact about the genealogy data on this website.') ?>
168            </div>
169        </div>
170    </div>
171
172    <!-- WEBMASTER_USER_ID -->
173    <div class="row mb-3">
174        <label class="col-sm-3 col-form-label" for="WEBMASTER_USER_ID">
175            <?= /* I18N: A configuration setting */ I18N::translate('Technical help contact') ?>
176        </label>
177        <div class="col-sm-9">
178            <select id="WEBMASTER_USER_ID" name="WEBMASTER_USER_ID" class="form-select">
179                <option value="">&nbsp;</option>
180                <?php foreach ($members as $member) : ?>
181                    <option value="<?= $member->id() ?>" <?= (int) $tree->getPreference('WEBMASTER_USER_ID') === $member->id() ? 'selected' : '' ?>>
182                        <?= e($member->realName()) ?> - <?= e($member->userName()) ?>
183                    </option>
184                <?php endforeach ?>
185            </select>
186            <div class="form-text">
187                <?= /* I18N: Help text for the “Technical help contact” configuration setting */ I18N::translate('The individual to be contacted about technical questions or errors encountered on your website.') ?>
188            </div>
189        </div>
190    </div>
191
192    <h2><?= I18N::translate('Website') ?></h2>
193
194    <!-- META_TITLE -->
195    <div class="row mb-3">
196        <label class="col-sm-3 col-form-label" for="META_TITLE">
197            <?= /* I18N: A configuration setting */ I18N::translate('Add to TITLE header tag') ?>
198        </label>
199        <div class="col-sm-9">
200            <input
201                class="form-control"
202                id="META_TITLE"
203                maxlength="255"
204                name="META_TITLE"
205                type="text"
206                value="<?= e($tree->getPreference('META_TITLE')) ?>"
207            >
208            <div class="form-text">
209                <?= /* I18N: Help text for the “Add to TITLE header tag” configuration setting */ I18N::translate('This text will be appended to each page title. It will be shown in the browser’s title bar, bookmarks, etc.') ?>
210            </div>
211        </div>
212    </div>
213
214    <!-- META_DESCRIPTION -->
215    <div class="row mb-3">
216        <label class="col-sm-3 col-form-label" for="META_DESCRIPTION">
217            <?= /* I18N: A configuration setting */ I18N::translate('Description META tag') ?>
218        </label>
219        <div class="col-sm-9">
220            <input
221                class="form-control"
222                id="META_DESCRIPTION"
223                maxlength="255"
224                name="META_DESCRIPTION"
225                type="text"
226                value="<?= e($tree->getPreference('META_DESCRIPTION')) ?>"
227            >
228            <div class="form-text">
229                <?= /* I18N: Help text for the “Description META tag” configuration setting */ I18N::translate('Search engines may use this description of your site in their search results.') ?>
230            </div>
231        </div>
232    </div>
233
234    <?php if (Auth::isAdmin()) : ?>
235        <h2><?= I18N::translate('Media folders') ?></h2>
236
237        <!-- MEDIA_DIRECTORY -->
238        <div class="row mb-3">
239            <label class="col-sm-3 col-form-label" for="MEDIA_DIRECTORY">
240                <?= /* I18N: A configuration setting */ I18N::translate('Media folder') ?>
241            </label>
242            <div class="col-sm-9">
243                <div class="input-group" dir="ltr">
244                    <span class="input-group-text" dir="ltr">
245                        <?= e($data_folder) ?>
246                    </span>
247
248                    <input class="form-control" dir="ltr" id="MEDIA_DIRECTORY" maxlength="255" name="MEDIA_DIRECTORY" type="text" value="<?= e($tree->getPreference('MEDIA_DIRECTORY')) ?>">
249                </div>
250
251                <div class="form-text">
252                    <?= /* I18N: Help text for the “Media folder” configuration setting */ I18N::translate('This folder will be used to store the media files for this family tree.') ?>
253                    <?= /* I18N: Help text for the “Media folder” configuration setting */ I18N::translate('If you select a different folder, you must also move any media files from the existing folder to the new one.') ?>
254                    <?= /* I18N: Help text for the “Media folder” configuration setting */ I18N::translate('If two family trees use the same media folder, then they will be able to share media files. If they use different media folders, then their media files will be kept separate.') ?>
255                </div>
256            </div>
257        </div>
258    <?php endif ?>
259
260    <h2><?= I18N::translate('Media files') ?></h2>
261
262    <!-- MEDIA_UPLOAD -->
263    <div class="row mb-3">
264        <label class="col-sm-3 col-form-label" for="MEDIA_UPLOAD">
265            <?= /* I18N: A configuration setting */ I18N::translate('Who can upload new media files') ?>
266        </label>
267        <div class="col-sm-9">
268            <?= view('components/select', ['name' => 'MEDIA_UPLOAD', 'selected' => $tree->getPreference('MEDIA_UPLOAD'), 'options' => $privacy_options]) ?>
269            <div class="form-text">
270                <?= /* 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.') ?>
271            </div>
272        </div>
273    </div>
274
275    <!-- SHOW_MEDIA_DOWNLOAD -->
276    <fieldset class="row mb-3">
277        <legend class="col-form-label col-sm-3">
278            <?= /* I18N: A configuration setting */ I18N::translate('Show a download link in the media viewer') ?>
279        </legend>
280        <div class="col-sm-9">
281            <?= view('components/select', ['name' => 'SHOW_MEDIA_DOWNLOAD', 'selected' => $tree->getPreference('SHOW_MEDIA_DOWNLOAD'), 'options' => Auth::accessLevelNames()]) ?>
282            <div class="form-text">
283                <?= /* 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.') ?>
284            </div>
285        </div>
286    </fieldset>
287
288    <h2><?= I18N::translate('Thumbnail images') ?></h2>
289
290    <!-- SHOW_HIGHLIGHT_IMAGES -->
291    <fieldset class="row mb-3">
292        <legend class="col-form-label col-sm-3">
293            <?= I18N::translate('Thumbnail images') ?>
294        </legend>
295        <div class="col-sm-9">
296            <?= view('components/radios-inline', ['name' => 'SHOW_HIGHLIGHT_IMAGES', 'options' => [I18N::translate('hide'), I18N::translate('show')], 'selected' => (int) $tree->getPreference('SHOW_HIGHLIGHT_IMAGES')]) ?>
297            <div class="form-text">
298                <?= I18N::translate('Show thumbnail images in charts and family groups.') ?>
299            </div>
300        </div>
301    </fieldset>
302
303    <!-- USE_SILHOUETTE -->
304    <fieldset class="row mb-3">
305        <legend class="col-form-label col-sm-3">
306            <?= /* I18N: A configuration setting */ I18N::translate('Use silhouettes') ?>
307        </legend>
308        <div class="col-sm-9">
309            <?= view('components/radios-inline', ['name' => 'USE_SILHOUETTE', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $tree->getPreference('USE_SILHOUETTE')]) ?>
310            <div class="form-text">
311                <?= /* 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.') ?>
312            </div>
313        </div>
314    </fieldset>
315
316    <h2><?= I18N::translate('Watermarks') ?></h2>
317
318    <!-- SHOW_NO_WATERMARK -->
319    <div class="row mb-3">
320        <label class="col-sm-3 col-form-label" for="SHOW_NO_WATERMARK">
321            <?= I18N::translate('Images without watermarks') ?>
322        </label>
323        <div class="col-sm-9">
324            <?= view('components/select', ['name' => 'SHOW_NO_WATERMARK', 'selected' => $tree->getPreference('SHOW_NO_WATERMARK'), 'options' => Auth::accessLevelNames()]) ?>
325            <div class="form-text">
326                <?= /* I18N: Help text for the “Images without watermarks” configuration setting */ I18N::translate('Watermarks are optional and normally shown just to visitors.') ?>
327            </div>
328        </div>
329    </div>
330
331    <h2><?= I18N::translate('Lists') ?></h2>
332
333    <!-- SURNAME_LIST_STYLE -->
334    <div class="row mb-3">
335        <label class="col-sm-3 col-form-label" for="SURNAME_LIST_STYLE">
336            <?= I18N::translate('Surname list style') ?>
337        </label>
338        <div class="col-sm-9">
339            <?= view('components/select', ['name' => 'SURNAME_LIST_STYLE', 'selected' => $tree->getPreference('SURNAME_LIST_STYLE'), 'options' => $surname_list_styles]) ?>
340            <div class="form-text">
341            </div>
342        </div>
343    </div>
344
345    <!-- SUBLIST_TRIGGER_I -->
346    <div class="row mb-3">
347        <label class="col-sm-3 col-form-label" for="SUBLIST_TRIGGER_I">
348            <?= /* I18N: A configuration setting */ I18N::translate('Maximum number of surnames on individual list') ?>
349        </label>
350        <div class="col-sm-9">
351            <input
352                class="form-control"
353                id="SUBLIST_TRIGGER_I"
354                maxlength="5"
355                name="SUBLIST_TRIGGER_I"
356                required
357                type="text"
358                value="<?= e($tree->getPreference('SUBLIST_TRIGGER_I')) ?>"
359            >
360            <div class="form-text">
361                <?= /* I18N: Help text for the “Maximum number of surnames on individual list” configuration setting */ I18N::translate('Long lists of individuals with the same surname can be broken into smaller sub-lists according to the first letter of the individual’s given name.<br><br>This option determines when sub-listing of surnames will occur. To disable sub-listing completely, set this option to zero.') ?>
362            </div>
363        </div>
364    </div>
365
366    <!-- SHOW_EST_LIST_DATES -->
367    <fieldset class="row mb-3">
368        <legend class="col-form-label col-sm-3">
369            <?= /* I18N: A configuration setting */ I18N::translate('Estimated dates for birth and death') ?>
370        </legend>
371        <div class="col-sm-9">
372            <?= view('components/radios-inline', ['name' => 'SHOW_EST_LIST_DATES', 'options' => [I18N::translate('hide'), I18N::translate('show')], 'selected' => (int) $tree->getPreference('SHOW_EST_LIST_DATES')]) ?>
373            <div class="form-text">
374                <?= /* 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.') ?>
375            </div>
376        </div>
377    </fieldset>
378
379    <!-- SHOW_LAST_CHANGE -->
380    <fieldset class="row mb-3">
381        <legend class="col-form-label col-sm-3">
382            <?= I18N::translate('The date and time of the last update') ?>
383        </legend>
384        <div class="col-sm-9">
385            <?= view('components/radios-inline', ['name' => 'SHOW_LAST_CHANGE', 'options' => [I18N::translate('hide'), I18N::translate('show')], 'selected' => (int) $tree->getPreference('SHOW_LAST_CHANGE')]) ?>
386            <div class="form-text">
387            </div>
388        </div>
389    </fieldset>
390
391    <h2><?= I18N::translate('Charts') ?></h2>
392
393    <!-- SHOW_PARENTS_AGE -->
394    <fieldset class="row mb-3">
395        <legend class="col-form-label col-sm-3">
396            <?= /* I18N: A configuration setting */ I18N::translate('Age of parents next to child’s birthdate') ?>
397        </legend>
398        <div class="col-sm-9">
399            <?= view('components/radios-inline', ['name' => 'SHOW_PARENTS_AGE', 'options' => [I18N::translate('hide'), I18N::translate('show')], 'selected' => (int) $tree->getPreference('SHOW_PARENTS_AGE')]) ?>
400            <div class="form-text">
401                <?= /* 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.') ?>
402            </div>
403        </div>
404    </fieldset>
405
406    <!-- CHART_BOX_TAGS -->
407    <div class="row mb-3">
408        <label class="col-sm-3 col-form-label" for="CHART_BOX_TAGS">
409            <?= I18N::translate('Other facts to show in charts') ?>
410        </label>
411        <div class="col-sm-9">
412            <div class="input-group">
413                <?= view('components/select', ['name' => 'CHART_BOX_TAGS[]', 'id' => 'CHART_BOX_TAGS', 'selected' => explode(',', $tree->getPreference('CHART_BOX_TAGS')), 'options' => $all_individual_facts, 'class' => 'tom-select']) ?>
414            </div>
415        </div>
416    </div>
417
418    <h2><?= I18N::translate('Individual pages') ?></h2>
419
420    <!-- SHOW_RELATIVES_EVENTS -->
421    <fieldset class="row mb-3">
422        <legend class="col-form-label col-sm-3">
423            <?= I18N::translate('Show the events of close relatives on the individual page') ?>
424        </legend>
425        <div class="col-sm-3">
426            <div class="form-check">
427                <label for="_BIRT_GCHI">
428                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_BIRT_GCHI" value="_BIRT_GCHI" <?= in_array('_BIRT_GCHI', $relatives_events, true) ? 'checked' : '' ?>>
429                    <?= I18N::translate('Birth of a grandchild') ?>
430                </label>
431            </div>
432            <div class="form-check">
433                <label for="_BIRT_CHIL">
434                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_BIRT_CHIL" value="_BIRT_CHIL" <?= in_array('_BIRT_CHIL', $relatives_events, true) ? 'checked' : '' ?>>
435                    <?= I18N::translate('Birth of a child') ?>
436                </label>
437            </div>
438            <div class="form-check">
439                <label for="_BIRT_SIBL">
440                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_BIRT_SIBL" value="_BIRT_SIBL" <?= in_array('_BIRT_SIBL', $relatives_events, true) ? 'checked' : '' ?>>
441                    <?= I18N::translate('Birth of a sibling') ?>
442                </label>
443            </div>
444        </div>
445        <div class="col-sm-3">
446            <div class="form-check">
447                <label for="_MARR_GCHI">
448                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_MARR_GCHI" value="_MARR_GCHI" <?= in_array('_MARR_GCHI', $relatives_events, true) ? 'checked' : '' ?>>
449                    <?= I18N::translate('Marriage of a grandchild') ?>
450                </label>
451            </div>
452            <div class="form-check">
453                <label for="_MARR_CHIL">
454                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_MARR_CHIL" value="_MARR_CHIL" <?= in_array('_MARR_CHIL', $relatives_events, true) ? 'checked' : '' ?>>
455                    <?= I18N::translate('Marriage of a child') ?>
456                </label>
457            </div>
458            <div class="form-check">
459                <label for="_MARR_SIBL">
460                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_MARR_SIBL" value="_MARR_SIBL" <?= in_array('_MARR_SIBL', $relatives_events, true) ? 'checked' : '' ?>>
461                    <?= I18N::translate('Marriage of a sibling') ?>
462                </label>
463            </div>
464            <div class="form-check">
465                <label for="_MARR_PARE">
466                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_MARR_PARE" value="_MARR_PARE" <?= in_array('_MARR_PARE', $relatives_events, true) ? 'checked' : '' ?>>
467                    <?= I18N::translate('Marriage of a parent') ?>
468                </label>
469            </div>
470        </div>
471        <div class="col-sm-3">
472            <div class="form-check">
473                <label for="_DEAT_GCHI">
474                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_DEAT_GCHI" value="_DEAT_GCHI" <?= in_array('_DEAT_GCHI', $relatives_events, true) ? 'checked' : '' ?>>
475                    <?= I18N::translate('Death of a grandchild') ?>
476                </label>
477            </div>
478            <div class="form-check">
479                <label for="_DEAT_CHIL">
480                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_DEAT_CHIL" value="_DEAT_CHIL" <?= in_array('_DEAT_CHIL', $relatives_events, true) ? 'checked' : '' ?>>
481                    <?= I18N::translate('Death of a child') ?>
482                </label>
483            </div>
484            <div class="form-check">
485                <label for="_DEAT_SIBL">
486                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_DEAT_SIBL" value="_DEAT_SIBL" <?= in_array('_DEAT_SIBL', $relatives_events, true) ? 'checked' : '' ?>>
487                    <?= I18N::translate('Death of a sibling') ?>
488                </label>
489            </div>
490            <div class="form-check">
491                <label for="_DEAT_PARE">
492                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_DEAT_PARE" value="_DEAT_PARE" <?= in_array('_DEAT_PARE', $relatives_events, true) ? 'checked' : '' ?>>
493                    <?= I18N::translate('Death of a parent') ?>
494                </label>
495            </div>
496            <div class="form-check">
497                <label for="_DEAT_SPOU">
498                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_DEAT_SPOU" value="_DEAT_SPOU" <?= in_array('_DEAT_SPOU', $relatives_events, true) ? 'checked' : '' ?>>
499                    <?= I18N::translate('Death of a spouse') ?>
500                </label>
501            </div>
502            <div class="form-check">
503                <label for="_DEAT_GPAR">
504                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_DEAT_GPAR" value="_DEAT_GPAR" <?= in_array('_DEAT_GPAR', $relatives_events, true) ? 'checked' : '' ?>>
505                    <?= I18N::translate('Death of a grandparent') ?>
506                </label>
507            </div>
508        </div>
509    </fieldset>
510
511    <!-- SHOW_FACT_ICONS -->
512    <fieldset class="row mb-3">
513        <legend class="col-form-label col-sm-3">
514            <?= /* I18N: A configuration setting */ I18N::translate('Fact icons') ?>
515        </legend>
516        <div class="col-sm-9">
517            <?= view('components/radios-inline', ['name' => 'SHOW_FACT_ICONS', 'options' => [I18N::translate('hide'), I18N::translate('show')], 'selected' => (int) $tree->getPreference('SHOW_FACT_ICONS')]) ?>
518            <div class="form-text">
519                <?= /* I18N: Help text for the “Fact icons” configuration setting */ I18N::translate('Some themes can display icons on the “Facts and events” tab.') ?>
520            </div>
521        </div>
522    </fieldset>
523
524    <!-- EXPAND_NOTES -->
525    <fieldset class="row mb-3">
526        <legend class="col-form-label col-sm-3">
527            <?= /* I18N: A configuration setting */ I18N::translate('Automatically expand notes') ?>
528        </legend>
529        <div class="col-sm-9">
530            <?= view('components/radios-inline', ['name' => 'EXPAND_NOTES', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $tree->getPreference('EXPAND_NOTES')]) ?>
531            <div class="form-text">
532                <?= /* I18N: Help text for the “Automatically expand notes” configuration setting */
533                I18N::translate('This option controls whether or not to automatically display content of a <i>Note</i> record on the Individual page.') ?>
534            </div>
535        </div>
536    </fieldset>
537
538    <!-- EXPAND_SOURCES -->
539    <fieldset class="row mb-3">
540        <legend class="col-form-label col-sm-3">
541            <?= /* I18N: A configuration setting */ I18N::translate('Automatically expand sources') ?>
542        </legend>
543        <div class="col-sm-9">
544            <?= view('components/radios-inline', ['name' => 'EXPAND_SOURCES', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $tree->getPreference('EXPAND_SOURCES')]) ?>
545            <div class="form-text">
546                <?= /* I18N: Help text for the “Automatically expand sources” configuration setting */
547                I18N::translate('This option controls whether or not to automatically display content of a <i>Source</i> record on the Individual page.') ?>
548            </div>
549        </div>
550    </fieldset>
551
552    <h2><?= I18N::translate('Places') ?></h2>
553
554    <!-- SHOW_PEDIGREE_PLACES -->
555    <fieldset class="row mb-3">
556        <legend class="col-form-label col-sm-3">
557            <?= /* I18N: A configuration setting */ I18N::translate('Abbreviate place names') ?>
558            <label class="visually-hidden" for="SHOW_PEDIGREE_PLACES_SUFFIX">
559                <?= /* I18N: A configuration setting */ I18N::translate('Abbreviate place names') ?>
560                <?= I18N::translate('first') ?> / <?= I18N::translate('last') ?>
561            </label>
562            <label class="visually-hidden" for="SHOW_PEDIGREE_PLACES">
563                <?= /* I18N: A configuration setting */ I18N::translate('Abbreviate place names') ?>
564            </label>
565        </legend>
566        <div class="col-sm-9">
567            <?= /* I18N: The placeholders are edit controls. Show the [first/last] [1/2/3/4/5] parts of a place name */ I18N::translate(
568                'Show the %1$s %2$s parts of a place name.',
569                view('components/select', ['name' => 'SHOW_PEDIGREE_PLACES_SUFFIX', 'selected' => $tree->getPreference('SHOW_PEDIGREE_PLACES_SUFFIX'), 'options' => ['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')]]),
570                view('components/select-number', ['name' => 'SHOW_PEDIGREE_PLACES', 'selected' => $tree->getPreference('SHOW_PEDIGREE_PLACES'), 'options' => range(1, 9)])
571            ) ?>
572            <div class="form-text">
573                <?= /* 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>.') ?>
574            </div>
575        </div>
576    </fieldset>
577
578    <h2><?= I18N::translate('Text') ?></h2>
579
580    <!-- FORMAT_TEXT -->
581    <fieldset class="row mb-3">
582        <legend class="col-form-label col-sm-3">
583            <?= /* I18N: A configuration setting */ I18N::translate('Format text and notes') ?>
584        </legend>
585        <div class="col-sm-9">
586            <?= view('components/radios-inline', ['name' => 'FORMAT_TEXT', 'options' => $formats, 'selected' =>  $tree->getPreference('FORMAT_TEXT')]) ?>
587            <div class="form-text">
588                <?= /* 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.') ?>
589                <br>
590                <?= /* I18N: Help text for the “Format text and notes” configuration setting */ I18N::translate('Markdown is a simple system of formatting, used on websites such as Wikipedia. It uses unobtrusive punctuation characters to create headings and sub-headings, bold and italic text, lists, tables, etc.') ?>
591            </div>
592        </div>
593    </fieldset>
594
595    <h2><?= I18N::translate('General') ?></h2>
596
597    <!-- SHOW_GEDCOM_RECORD -->
598    <fieldset class="row mb-3">
599        <legend class="col-form-label col-sm-3">
600            <?= /* I18N: A configuration setting */ I18N::translate('Allow users to see raw GEDCOM records') ?>
601        </legend>
602        <div class="col-sm-9">
603            <?= view('components/radios-inline', ['name' => 'SHOW_GEDCOM_RECORD', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $tree->getPreference('SHOW_GEDCOM_RECORD')]) ?>
604            <div class="form-text">
605                <?= /* 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.') ?>
606            </div>
607        </div>
608    </fieldset>
609
610    <!-- HIDE_GEDCOM_ERRORS -->
611    <fieldset class="row mb-3">
612        <legend class="col-form-label col-sm-3">
613            <?= /* I18N: A configuration setting */ I18N::translate('GEDCOM errors') ?>
614        </legend>
615        <div class="col-sm-9">
616            <?= view('components/radios-inline', ['name' => 'HIDE_GEDCOM_ERRORS', 'options' => [I18N::translate('hide'), I18N::translate('show')], 'selected' => (int) $tree->getPreference('HIDE_GEDCOM_ERRORS')]) ?>
617            <div class="form-text">
618                <?= /* 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.') ?>
619            </div>
620        </div>
621    </fieldset>
622
623    <!-- SHOW_COUNTER -->
624    <fieldset class="row mb-3">
625        <legend class="col-form-label col-sm-3">
626            <?= /* I18N: A configuration setting */ I18N::translate('Hit counters') ?>
627        </legend>
628        <div class="col-sm-9">
629            <?= view('components/radios-inline', ['name' => 'SHOW_COUNTER', 'options' => [I18N::translate('hide'), I18N::translate('show')], 'selected' => (int) $tree->getPreference('SHOW_COUNTER')]) ?>
630            <div class="form-text">
631                <?= /* I18N: Help text for the “Hit counters” configuration setting */ I18N::translate('Some pages can display the number of times that they have been visited.') ?>
632            </div>
633        </div>
634    </fieldset>
635
636    <h2><?= /* I18N: Options for editing */ I18N::translate('Edit preferences') ?></h2>
637
638    <h2><?= I18N::translate('Facts for individual records') ?></h2>
639
640    <!-- QUICK_REQUIRED_FACTS -->
641    <div class="row mb-3">
642        <label class="col-sm-3 col-form-label" for="QUICK_REQUIRED_FACTS">
643            <?= I18N::translate('Facts for new individuals') ?>
644        </label>
645        <div class="col-sm-9">
646            <?= view('components/select', ['name' => 'QUICK_REQUIRED_FACTS[]', 'id' => 'QUICK_REQUIRED_FACTS', 'selected' => explode(',', $tree->getPreference('QUICK_REQUIRED_FACTS')), 'options' => $all_individual_facts, 'class' => 'tom-select']) ?>
647        </div>
648    </div>
649
650    <!-- INDI_FACTS_QUICK -->
651    <div class="row mb-3">
652        <label class="col-sm-3 col-form-label" for="INDI_FACTS_QUICK">
653            <?= I18N::translate('Quick individual facts') ?>
654        </label>
655        <div class="col-sm-9">
656            <?= view('components/select', ['name' => 'INDI_FACTS_QUICK[]', 'id' => 'INDI_FACTS_QUICK', 'selected' => explode(',', $tree->getPreference('INDI_FACTS_QUICK')), 'options' => $all_individual_facts, 'class' => 'tom-select']) ?>
657            <div class="form-text">
658                <?= /* 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.') ?>
659            </div>
660        </div>
661    </div>
662
663    <h2><?= I18N::translate('Facts for family records') ?></h2>
664
665    <!-- QUICK_REQUIRED_FAMFACTS -->
666    <div class="row mb-3">
667        <label class="col-sm-3 col-form-label" for="QUICK_REQUIRED_FAMFACTS">
668            <?= I18N::translate('Facts for new families') ?>
669        </label>
670        <div class="col-sm-9">
671            <?= view('components/select', ['name' => 'QUICK_REQUIRED_FAMFACTS[]', 'id' => 'QUICK_REQUIRED_FAMFACTS', 'selected' => explode(',', $tree->getPreference('QUICK_REQUIRED_FAMFACTS')), 'options' => $all_family_facts, 'class' => 'tom-select']) ?>
672        </div>
673    </div>
674
675    <!-- FAM_FACTS_QUICK -->
676    <div class="row mb-3">
677        <label class="col-sm-3 col-form-label" for="FAM_FACTS_QUICK">
678            <?= I18N::translate('Quick family facts') ?>
679        </label>
680        <div class="col-sm-9">
681            <?= view('components/select', ['name' => 'FAM_FACTS_QUICK[]', 'id' => 'FAM_FACTS_QUICK', 'selected' => explode(',', $tree->getPreference('FAM_FACTS_QUICK')), 'options' => $all_family_facts, 'class' => 'tom-select']) ?>
682            <div class="form-text">
683                <?= /* 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.') ?>
684            </div>
685        </div>
686    </div>
687
688    <h2><?= I18N::translate('Other preferences') ?></h2>
689
690    <!-- SURNAME_TRADITION -->
691    <fieldset class="row mb-3">
692        <legend class="col-form-label col-sm-3">
693            <?= I18N::translate('Surname tradition') ?>
694        </legend>
695        <div class="col-sm-9">
696            <?= view('components/radios', ['name' => 'SURNAME_TRADITION', 'options' => $all_surname_traditions, 'selected' => $tree->getPreference('SURNAME_TRADITION')]) ?>
697            <div class="form-text">
698                <?= /* 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.') ?>
699            </div>
700        </div>
701    </fieldset>
702
703    <!-- NO_UPDATE_CHAN -->
704    <fieldset class="row mb-3">
705        <legend class="col-form-label col-sm-3">
706            <?= /* I18N: A configuration setting */ I18N::translate('Keep the existing “last change” information') ?>
707        </legend>
708        <div class="col-sm-9">
709            <?= view('components/radios-inline', ['name' => 'NO_UPDATE_CHAN', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $tree->getPreference('NO_UPDATE_CHAN')]) ?>
710            <div class="form-text">
711                <?= /* 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.') ?>
712            </div>
713        </div>
714    </fieldset>
715
716    <div class="row mb-3">
717        <div class="offset-sm-3 col-sm-9">
718            <button type="submit" class="btn btn-primary">
719                <?= view('icons/save') ?>
720                <?= I18N::translate('save') ?>
721            </button>
722            <a class="btn btn-secondary" href="<?= e(route(ManageTrees::class, ['tree' => $tree->name()])) ?>">
723                <?= view('icons/cancel') ?>
724                <?= I18N::translate('cancel') ?>
725            </a>
726            <!-- Coming soon
727            <div class="form-check">
728                <?php if ($tree_count > 1) : ?>
729                <label>
730                    <input type="checkbox" name="all_trees">
731                    <?= /* I18N: Label for checkbox */ I18N::translate('Apply these preferences to all family trees') ?>
732                </label>
733                <?php endif ?>
734            </div>
735            <div class="form-check">
736                <label>
737                    <input type="checkbox" name="new_trees">
738                    <?= /* I18N: Label for checkbox */ I18N::translate('Apply these preferences to new family trees') ?>
739                </label>
740            </div>
741            -->
742        </div>
743    </div>
744
745    <?= csrf_field() ?>
746</form>
747