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