xref: /webtrees/resources/views/admin/trees-preferences.phtml (revision 0dea6cff3c3bc89b05fca58423f45326cbda59bd)
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                max="99999"
355                min="0"
356                name="SUBLIST_TRIGGER_I"
357                required
358                type="number"
359                value="<?= e($tree->getPreference('SUBLIST_TRIGGER_I')) ?>"
360            >
361            <div class="form-text">
362                <?= /* 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.') ?>
363            </div>
364        </div>
365    </div>
366
367    <!-- SHOW_EST_LIST_DATES -->
368    <fieldset class="row mb-3">
369        <legend class="col-form-label col-sm-3">
370            <?= /* I18N: A configuration setting */ I18N::translate('Estimated dates for birth and death') ?>
371        </legend>
372        <div class="col-sm-9">
373            <?= view('components/radios-inline', ['name' => 'SHOW_EST_LIST_DATES', 'options' => [I18N::translate('hide'), I18N::translate('show')], 'selected' => (int) $tree->getPreference('SHOW_EST_LIST_DATES')]) ?>
374            <div class="form-text">
375                <?= /* 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.') ?>
376            </div>
377        </div>
378    </fieldset>
379
380    <!-- SHOW_LAST_CHANGE -->
381    <fieldset class="row mb-3">
382        <legend class="col-form-label col-sm-3">
383            <?= I18N::translate('The date and time of the last update') ?>
384        </legend>
385        <div class="col-sm-9">
386            <?= view('components/radios-inline', ['name' => 'SHOW_LAST_CHANGE', 'options' => [I18N::translate('hide'), I18N::translate('show')], 'selected' => (int) $tree->getPreference('SHOW_LAST_CHANGE')]) ?>
387            <div class="form-text">
388            </div>
389        </div>
390    </fieldset>
391
392    <h2><?= I18N::translate('Charts') ?></h2>
393
394    <!-- SHOW_PARENTS_AGE -->
395    <fieldset class="row mb-3">
396        <legend class="col-form-label col-sm-3">
397            <?= /* I18N: A configuration setting */ I18N::translate('Age of parents next to child’s birthdate') ?>
398        </legend>
399        <div class="col-sm-9">
400            <?= view('components/radios-inline', ['name' => 'SHOW_PARENTS_AGE', 'options' => [I18N::translate('hide'), I18N::translate('show')], 'selected' => (int) $tree->getPreference('SHOW_PARENTS_AGE')]) ?>
401            <div class="form-text">
402                <?= /* 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.') ?>
403            </div>
404        </div>
405    </fieldset>
406
407    <!-- CHART_BOX_TAGS -->
408    <div class="row mb-3">
409        <label class="col-sm-3 col-form-label" for="CHART_BOX_TAGS">
410            <?= I18N::translate('Other facts to show in charts') ?>
411        </label>
412        <div class="col-sm-9">
413            <div class="input-group">
414                <?= 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']) ?>
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    <!-- NO_UPDATE_CHAN -->
705    <fieldset class="row mb-3">
706        <legend class="col-form-label col-sm-3">
707            <?= /* I18N: A configuration setting */ I18N::translate('Keep the existing “last change” information') ?>
708        </legend>
709        <div class="col-sm-9">
710            <?= view('components/radios-inline', ['name' => 'NO_UPDATE_CHAN', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $tree->getPreference('NO_UPDATE_CHAN')]) ?>
711            <div class="form-text">
712                <?= /* 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.') ?>
713            </div>
714        </div>
715    </fieldset>
716
717    <div class="row mb-3">
718        <div class="offset-sm-3 col-sm-9">
719            <button type="submit" class="btn btn-primary">
720                <?= view('icons/save') ?>
721                <?= I18N::translate('save') ?>
722            </button>
723            <a class="btn btn-secondary" href="<?= e(route(ManageTrees::class, ['tree' => $tree->name()])) ?>">
724                <?= view('icons/cancel') ?>
725                <?= I18N::translate('cancel') ?>
726            </a>
727            <!-- Coming soon
728            <div class="form-check">
729                <?php if ($tree_count > 1) : ?>
730                <label>
731                    <input type="checkbox" name="all_trees">
732                    <?= /* I18N: Label for checkbox */ I18N::translate('Apply these preferences to all family trees') ?>
733                </label>
734                <?php endif ?>
735            </div>
736            <div class="form-check">
737                <label>
738                    <input type="checkbox" name="new_trees">
739                    <?= /* I18N: Label for checkbox */ I18N::translate('Apply these preferences to new family trees') ?>
740                </label>
741            </div>
742            -->
743        </div>
744    </div>
745
746    <?= csrf_field() ?>
747</form>
748