xref: /webtrees/resources/views/admin/trees-preferences.phtml (revision d4ec5ec0fe611c85b1d77527db3e9becde7e473d)
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<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    <?= csrf_field() ?>
44
45    <h2><?= I18N::translate('General') ?></h2>
46
47    <!-- TREE TITLE -->
48    <div class="row form-group 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 form-group 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 form-group 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 form-group 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 form-group 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 form-group 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-control">
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 form-group 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-control">
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 form-group 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 form-group 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 form-group 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 form-group 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 form-group 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 form-group 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 form-group 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 form-group 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 form-group 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 form-group 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 form-group 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 form-group 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 form-group 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 form-group 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 class="form-text">
416                <?= /* 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.') ?>
417            </div>
418        </div>
419    </div>
420
421    <h2><?= I18N::translate('Individual pages') ?></h2>
422
423    <!-- SHOW_RELATIVES_EVENTS -->
424    <fieldset class="row form-group mb-3">
425        <legend class="col-form-label col-sm-3">
426            <?= I18N::translate('Show the events of close relatives on the individual page') ?>
427        </legend>
428        <div class="col-sm-3">
429            <div class="form-check">
430                <label for="_BIRT_GCHI">
431                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_BIRT_GCHI" value="_BIRT_GCHI" <?= in_array('_BIRT_GCHI', $relatives_events, true) ? 'checked' : '' ?>>
432                    <?= I18N::translate('Birth of a grandchild') ?>
433                </label>
434            </div>
435            <div class="form-check">
436                <label for="_BIRT_CHIL">
437                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_BIRT_CHIL" value="_BIRT_CHIL" <?= in_array('_BIRT_CHIL', $relatives_events, true) ? 'checked' : '' ?>>
438                    <?= I18N::translate('Birth of a child') ?>
439                </label>
440            </div>
441            <div class="form-check">
442                <label for="_BIRT_SIBL">
443                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_BIRT_SIBL" value="_BIRT_SIBL" <?= in_array('_BIRT_SIBL', $relatives_events, true) ? 'checked' : '' ?>>
444                    <?= I18N::translate('Birth of a sibling') ?>
445                </label>
446            </div>
447        </div>
448        <div class="col-sm-3">
449            <div class="form-check">
450                <label for="_MARR_GCHI">
451                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_MARR_GCHI" value="_MARR_GCHI" <?= in_array('_MARR_GCHI', $relatives_events, true) ? 'checked' : '' ?>>
452                    <?= I18N::translate('Marriage of a grandchild') ?>
453                </label>
454            </div>
455            <div class="form-check">
456                <label for="_MARR_CHIL">
457                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_MARR_CHIL" value="_MARR_CHIL" <?= in_array('_MARR_CHIL', $relatives_events, true) ? 'checked' : '' ?>>
458                    <?= I18N::translate('Marriage of a child') ?>
459                </label>
460            </div>
461            <div class="form-check">
462                <label for="_MARR_SIBL">
463                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_MARR_SIBL" value="_MARR_SIBL" <?= in_array('_MARR_SIBL', $relatives_events, true) ? 'checked' : '' ?>>
464                    <?= I18N::translate('Marriage of a sibling') ?>
465                </label>
466            </div>
467            <div class="form-check">
468                <label for="_MARR_PARE">
469                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_MARR_PARE" value="_MARR_PARE" <?= in_array('_MARR_PARE', $relatives_events, true) ? 'checked' : '' ?>>
470                    <?= I18N::translate('Marriage of a parent') ?>
471                </label>
472            </div>
473        </div>
474        <div class="col-sm-3">
475            <div class="form-check">
476                <label for="_DEAT_GCHI">
477                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_DEAT_GCHI" value="_DEAT_GCHI" <?= in_array('_DEAT_GCHI', $relatives_events, true) ? 'checked' : '' ?>>
478                    <?= I18N::translate('Death of a grandchild') ?>
479                </label>
480            </div>
481            <div class="form-check">
482                <label for="_DEAT_CHIL">
483                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_DEAT_CHIL" value="_DEAT_CHIL" <?= in_array('_DEAT_CHIL', $relatives_events, true) ? 'checked' : '' ?>>
484                    <?= I18N::translate('Death of a child') ?>
485                </label>
486            </div>
487            <div class="form-check">
488                <label for="_DEAT_SIBL">
489                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_DEAT_SIBL" value="_DEAT_SIBL" <?= in_array('_DEAT_SIBL', $relatives_events, true) ? 'checked' : '' ?>>
490                    <?= I18N::translate('Death of a sibling') ?>
491                </label>
492            </div>
493            <div class="form-check">
494                <label for="_DEAT_PARE">
495                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_DEAT_PARE" value="_DEAT_PARE" <?= in_array('_DEAT_PARE', $relatives_events, true) ? 'checked' : '' ?>>
496                    <?= I18N::translate('Death of a parent') ?>
497                </label>
498            </div>
499            <div class="form-check">
500                <label for="_DEAT_SPOU">
501                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_DEAT_SPOU" value="_DEAT_SPOU" <?= in_array('_DEAT_SPOU', $relatives_events, true) ? 'checked' : '' ?>>
502                    <?= I18N::translate('Death of a spouse') ?>
503                </label>
504            </div>
505            <div class="form-check">
506                <label for="_DEAT_GPAR">
507                    <input name="SHOW_RELATIVES_EVENTS[]" type="checkbox" id="_DEAT_GPAR" value="_DEAT_GPAR" <?= in_array('_DEAT_GPAR', $relatives_events, true) ? 'checked' : '' ?>>
508                    <?= I18N::translate('Death of a grandparent') ?>
509                </label>
510            </div>
511        </div>
512    </fieldset>
513
514    <!-- SHOW_FACT_ICONS -->
515    <fieldset class="row form-group mb-3">
516        <legend class="col-form-label col-sm-3">
517            <?= /* I18N: A configuration setting */ I18N::translate('Fact icons') ?>
518        </legend>
519        <div class="col-sm-9">
520            <?= view('components/radios-inline', ['name' => 'SHOW_FACT_ICONS', 'options' => [I18N::translate('hide'), I18N::translate('show')], 'selected' => (int) $tree->getPreference('SHOW_FACT_ICONS')]) ?>
521            <div class="form-text">
522                <?= /* I18N: Help text for the “Fact icons” configuration setting */ I18N::translate('Some themes can display icons on the “Facts and events” tab.') ?>
523            </div>
524        </div>
525    </fieldset>
526
527    <!-- EXPAND_NOTES -->
528    <fieldset class="row form-group mb-3">
529        <legend class="col-form-label col-sm-3">
530            <?= /* I18N: A configuration setting */ I18N::translate('Automatically expand notes') ?>
531        </legend>
532        <div class="col-sm-9">
533            <?= view('components/radios-inline', ['name' => 'EXPAND_NOTES', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $tree->getPreference('EXPAND_NOTES')]) ?>
534            <div class="form-text">
535                <?= /* I18N: Help text for the “Automatically expand notes” configuration setting */
536                I18N::translate('This option controls whether or not to automatically display content of a <i>Note</i> record on the Individual page.') ?>
537            </div>
538        </div>
539    </fieldset>
540
541    <!-- EXPAND_SOURCES -->
542    <fieldset class="row form-group mb-3">
543        <legend class="col-form-label col-sm-3">
544            <?= /* I18N: A configuration setting */ I18N::translate('Automatically expand sources') ?>
545        </legend>
546        <div class="col-sm-9">
547            <?= view('components/radios-inline', ['name' => 'EXPAND_SOURCES', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $tree->getPreference('EXPAND_SOURCES')]) ?>
548            <div class="form-text">
549                <?= /* I18N: Help text for the “Automatically expand sources” configuration setting */
550                I18N::translate('This option controls whether or not to automatically display content of a <i>Source</i> record on the Individual page.') ?>
551            </div>
552        </div>
553    </fieldset>
554
555    <h2><?= I18N::translate('Places') ?></h2>
556
557    <!-- SHOW_PEDIGREE_PLACES -->
558    <fieldset class="row form-group mb-3">
559        <legend class="col-form-label col-sm-3">
560            <?= /* I18N: A configuration setting */ I18N::translate('Abbreviate place names') ?>
561            <label class="visually-hidden" for="SHOW_PEDIGREE_PLACES_SUFFIX">
562                <?= /* I18N: A configuration setting */ I18N::translate('Abbreviate place names') ?>
563                <?= I18N::translate('first') ?> / <?= I18N::translate('last') ?>
564            </label>
565            <label class="visually-hidden" for="SHOW_PEDIGREE_PLACES">
566                <?= /* I18N: A configuration setting */ I18N::translate('Abbreviate place names') ?>
567            </label>
568        </legend>
569        <div class="col-sm-9">
570            <?= /* I18N: The placeholders are edit controls. Show the [first/last] [1/2/3/4/5] parts of a place name */ I18N::translate(
571                'Show the %1$s %2$s parts of a place name.',
572                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')]]),
573                view('components/select-number', ['name' => 'SHOW_PEDIGREE_PLACES', 'selected' => $tree->getPreference('SHOW_PEDIGREE_PLACES'), 'options' => range(1, 9)])
574            ) ?>
575            <div class="form-text">
576                <?= /* 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>.') ?>
577            </div>
578        </div>
579    </fieldset>
580
581    <h2><?= I18N::translate('Text') ?></h2>
582
583    <!-- FORMAT_TEXT -->
584    <fieldset class="row form-group mb-3">
585        <legend class="col-form-label col-sm-3">
586            <?= /* I18N: A configuration setting */ I18N::translate('Format text and notes') ?>
587        </legend>
588        <div class="col-sm-9">
589            <?= view('components/radios-inline', ['name' => 'FORMAT_TEXT', 'options' => $formats, 'selected' =>  $tree->getPreference('FORMAT_TEXT')]) ?>
590            <div class="form-text">
591                <?= /* 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.') ?>
592                <br>
593                <?= /* 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.') ?>
594            </div>
595        </div>
596    </fieldset>
597
598    <h2><?= I18N::translate('General') ?></h2>
599
600    <!-- SHOW_GEDCOM_RECORD -->
601    <fieldset class="row form-group mb-3">
602        <legend class="col-form-label col-sm-3">
603            <?= /* I18N: A configuration setting */ I18N::translate('Allow users to see raw GEDCOM records') ?>
604        </legend>
605        <div class="col-sm-9">
606            <?= view('components/radios-inline', ['name' => 'SHOW_GEDCOM_RECORD', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $tree->getPreference('SHOW_GEDCOM_RECORD')]) ?>
607            <div class="form-text">
608                <?= /* 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.') ?>
609            </div>
610        </div>
611    </fieldset>
612
613    <!-- HIDE_GEDCOM_ERRORS -->
614    <fieldset class="row form-group mb-3">
615        <legend class="col-form-label col-sm-3">
616            <?= /* I18N: A configuration setting */ I18N::translate('GEDCOM errors') ?>
617        </legend>
618        <div class="col-sm-9">
619            <?= view('components/radios-inline', ['name' => 'HIDE_GEDCOM_ERRORS', 'options' => [I18N::translate('hide'), I18N::translate('show')], 'selected' => (int) $tree->getPreference('HIDE_GEDCOM_ERRORS')]) ?>
620            <div class="form-text">
621                <?= /* 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.') ?>
622            </div>
623        </div>
624    </fieldset>
625
626    <!-- SHOW_COUNTER -->
627    <fieldset class="row form-group mb-3">
628        <legend class="col-form-label col-sm-3">
629            <?= /* I18N: A configuration setting */ I18N::translate('Hit counters') ?>
630        </legend>
631        <div class="col-sm-9">
632            <?= view('components/radios-inline', ['name' => 'SHOW_COUNTER', 'options' => [I18N::translate('hide'), I18N::translate('show')], 'selected' => (int) $tree->getPreference('SHOW_COUNTER')]) ?>
633            <div class="form-text">
634                <?= /* I18N: Help text for the “Hit counters” configuration setting */ I18N::translate('Some pages can display the number of times that they have been visited.') ?>
635            </div>
636        </div>
637    </fieldset>
638
639    <h2><?= /* I18N: Options for editing */ I18N::translate('Edit preferences') ?></h2>
640
641    <h2><?= I18N::translate('Facts for individual records') ?></h2>
642
643    <!-- QUICK_REQUIRED_FACTS -->
644    <div class="row form-group mb-3">
645        <label class="col-sm-3 col-form-label" for="QUICK_REQUIRED_FACTS">
646            <?= I18N::translate('Facts for new individuals') ?>
647        </label>
648        <div class="col-sm-9">
649            <?= 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']) ?>
650        </div>
651    </div>
652
653    <!-- INDI_FACTS_QUICK -->
654    <div class="row form-group mb-3">
655        <label class="col-sm-3 col-form-label" for="INDI_FACTS_QUICK">
656            <?= I18N::translate('Quick individual facts') ?>
657        </label>
658        <div class="col-sm-9">
659            <?= 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']) ?>
660            <div class="form-text">
661                <?= /* 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.') ?>
662            </div>
663        </div>
664    </div>
665
666    <h2><?= I18N::translate('Facts for family records') ?></h2>
667
668    <!-- QUICK_REQUIRED_FAMFACTS -->
669    <div class="row form-group mb-3">
670        <label class="col-sm-3 col-form-label" for="QUICK_REQUIRED_FAMFACTS">
671            <?= I18N::translate('Facts for new families') ?>
672        </label>
673        <div class="col-sm-9">
674            <?= 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']) ?>
675        </div>
676    </div>
677
678    <!-- FAM_FACTS_QUICK -->
679    <div class="row form-group mb-3">
680        <label class="col-sm-3 col-form-label" for="FAM_FACTS_QUICK">
681            <?= I18N::translate('Quick family facts') ?>
682        </label>
683        <div class="col-sm-9">
684            <?= 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']) ?>
685            <div class="form-text">
686                <?= /* 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.') ?>
687            </div>
688        </div>
689    </div>
690
691    <h2><?= I18N::translate('Other preferences') ?></h2>
692
693    <!-- SURNAME_TRADITION -->
694    <fieldset class="row form-group mb-3">
695        <legend class="col-form-label col-sm-3">
696            <?= I18N::translate('Surname tradition') ?>
697        </legend>
698        <div class="col-sm-9">
699            <?= view('components/radios', ['name' => 'SURNAME_TRADITION', 'options' => $all_surname_traditions, 'selected' => $tree->getPreference('SURNAME_TRADITION')]) ?>
700            <div class="form-text">
701                <?= /* 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.') ?>
702            </div>
703        </div>
704    </fieldset>
705
706    <!-- FULL_SOURCES -->
707    <fieldset class="row form-group mb-3">
708        <legend class="col-form-label col-sm-3">
709            <?= /* I18N: A configuration setting */ I18N::translate('Use full source citations') ?>
710        </legend>
711        <div class="col-sm-9">
712            <?= view('components/radios-inline', ['name' => 'FULL_SOURCES', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $tree->getPreference('FULL_SOURCES')]) ?>
713            <div class="form-text">
714                <?= /* 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.') ?>
715            </div>
716        </div>
717    </fieldset>
718
719    <!-- PREFER_LEVEL2_SOURCES -->
720    <fieldset class="row form-group mb-3">
721        <legend class="col-form-label col-sm-3">
722            <?= /* I18N: A configuration setting */ I18N::translate('Source type') ?>
723        </legend>
724        <div class="col-sm-9">
725            <?= view('components/radios-inline', ['name' => 'PREFER_LEVEL2_SOURCES', 'options' => $source_types, 'selected' => (int) $tree->getPreference('PREFER_LEVEL2_SOURCES')]) ?>
726            <div class="form-text">
727                <?= /* 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.') ?>
728            </div>
729        </div>
730    </fieldset>
731
732    <!-- NO_UPDATE_CHAN -->
733    <fieldset class="row form-group mb-3">
734        <legend class="col-form-label col-sm-3">
735            <?= /* I18N: A configuration setting */ I18N::translate('Keep the existing “last change” information') ?>
736        </legend>
737        <div class="col-sm-9">
738            <?= view('components/radios-inline', ['name' => 'NO_UPDATE_CHAN', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $tree->getPreference('NO_UPDATE_CHAN')]) ?>
739            <div class="form-text">
740                <?= /* 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.') ?>
741            </div>
742        </div>
743    </fieldset>
744
745    <div class="row form-group mb-3">
746        <div class="offset-sm-3 col-sm-9">
747            <button type="submit" class="btn btn-primary">
748                <?= view('icons/save') ?>
749                <?= I18N::translate('save') ?>
750            </button>
751            <a class="btn btn-secondary" href="<?= e(route(ManageTrees::class, ['tree' => $tree->name()])) ?>">
752        <?= view('icons/cancel') ?>
753                <?= I18N::translate('cancel') ?>
754            </a>
755            <!-- Coming soon
756            <div class="form-check">
757                <?php if ($tree_count > 1) : ?>
758                <label>
759                    <input type="checkbox" name="all_trees">
760                    <?= /* I18N: Label for checkbox */ I18N::translate('Apply these preferences to all family trees') ?>
761                </label>
762                <?php endif ?>
763            </div>
764            <div class="form-check">
765                <label>
766                    <input type="checkbox" name="new_trees">
767                    <?= /* I18N: Label for checkbox */ I18N::translate('Apply these preferences to new family trees') ?>
768                </label>
769            </div>
770        </div>
771        -->
772        </div>
773</form>
774