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