forked from fisharebest/webtrees
-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_trees_config.php
1833 lines (1696 loc) · 84.3 KB
/
admin_trees_config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* webtrees: online genealogy
* Copyright (C) 2017 webtrees development team
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Fisharebest\Webtrees;
use Fisharebest\Webtrees\Controller\PageController;
use Fisharebest\Webtrees\Functions\FunctionsEdit;
/** @global Tree $WT_TREE */
global $WT_TREE;
require 'includes/session.php';
$controller = new PageController;
$controller->restrictAccess(Auth::isManager($WT_TREE));
$french_calendar_start = new Date('22 SEP 1792');
$french_calendar_end = new Date('31 DEC 1805');
$gregorian_calendar_start = new Date('15 OCT 1582');
$surname_list_styles = [
'style1' => /* I18N: Layout option for lists of names */ I18N::translate('list'),
'style2' => /* I18N: Layout option for lists of names */ I18N::translate('table'),
'style3' => /* I18N: Layout option for lists of names */ I18N::translate('tag cloud'),
];
$layouts = [
0 => /* I18N: page orientation */ I18N::translate('Portrait'),
1 => /* I18N: page orientation */ I18N::translate('Landscape'),
];
$formats = [
'' => /* I18N: None of the other options */ I18N::translate('none'),
'markdown' => /* I18N: https://en.wikipedia.org/wiki/Markdown */ I18N::translate('markdown'),
];
$source_types = [
0 => I18N::translate('none'),
1 => I18N::translate('facts'),
2 => I18N::translate('records'),
];
$THEME_OPTIONS = ['' => I18N::translate('<default theme>')] + Theme::themeNames();
$PRIVACY_CONSTANTS = [
'none' => I18N::translate('Show to visitors'),
'privacy' => I18N::translate('Show to members'),
'confidential' => I18N::translate('Show to managers'),
'hidden' => I18N::translate('Hide from everyone'),
];
$tags = array_unique(array_merge(
explode(',', $WT_TREE->getPreference('INDI_FACTS_ADD')), explode(',', $WT_TREE->getPreference('INDI_FACTS_UNIQUE')),
explode(',', $WT_TREE->getPreference('FAM_FACTS_ADD')), explode(',', $WT_TREE->getPreference('FAM_FACTS_UNIQUE')),
explode(',', $WT_TREE->getPreference('NOTE_FACTS_ADD')), explode(',', $WT_TREE->getPreference('NOTE_FACTS_UNIQUE')),
explode(',', $WT_TREE->getPreference('SOUR_FACTS_ADD')), explode(',', $WT_TREE->getPreference('SOUR_FACTS_UNIQUE')),
explode(',', $WT_TREE->getPreference('REPO_FACTS_ADD')), explode(',', $WT_TREE->getPreference('REPO_FACTS_UNIQUE')),
['SOUR', 'REPO', 'OBJE', '_PRIM', 'NOTE', 'SUBM', 'SUBN', '_UID', 'CHAN']
));
$all_tags = [];
foreach ($tags as $tag) {
if ($tag) {
$all_tags[$tag] = GedcomTag::getLabel($tag);
}
}
uasort($all_tags, '\Fisharebest\Webtrees\I18N::strcasecmp');
$resns = Database::prepare(
"SELECT default_resn_id, tag_type, xref, resn" .
" FROM `##default_resn`" .
" LEFT JOIN `##name` ON (gedcom_id=n_file AND xref=n_id AND n_num=0)" .
" WHERE gedcom_id=?" .
" ORDER BY xref IS NULL, n_sort, xref, tag_type"
)->execute([$WT_TREE->getTreeId()])->fetchAll();
foreach ($resns as $resn) {
$resn->record = GedcomRecord::getInstance($resn->xref, $WT_TREE);
if ($resn->tag_type) {
$resn->tag_label = GedcomTag::getLabel($resn->tag_type);
} else {
$resn->tag_label = '';
}
}
usort($resns, function (\stdClass $x, \stdClass $y) {
return I18N::strcasecmp($x->tag_label, $y->tag_label);
});
// We have two fields in one
$CALENDAR_FORMATS = explode('_and_', $WT_TREE->getPreference('CALENDAR_FORMAT') . '_and_');
// Split into separate fields
$relatives_events = explode(',', $WT_TREE->getPreference('SHOW_RELATIVES_EVENTS'));
switch (Filter::post('action')) {
case 'privacy':
foreach (Filter::postArray('delete', WT_REGEX_INTEGER) as $delete_resn) {
Database::prepare(
"DELETE FROM `##default_resn` WHERE default_resn_id=?"
)->execute([$delete_resn]);
}
$xrefs = Filter::postArray('xref', WT_REGEX_XREF);
$tag_types = Filter::postArray('tag_type', WT_REGEX_TAG);
$resns = Filter::postArray('resn');
foreach ($xrefs as $n => $xref) {
$tag_type = $tag_types[$n];
$resn = $resns[$n];
if ($tag_type || $xref) {
// Delete any existing data
if ($xref === '') {
Database::prepare(
"DELETE FROM `##default_resn` WHERE gedcom_id=? AND tag_type=? AND xref IS NULL"
)->execute([$WT_TREE->getTreeId(), $tag_type]);
}
if ($tag_type === '') {
Database::prepare(
"DELETE FROM `##default_resn` WHERE gedcom_id=? AND xref=? AND tag_type IS NULL"
)->execute([$WT_TREE->getTreeId(), $xref]);
}
// Add (or update) the new data
Database::prepare(
"REPLACE INTO `##default_resn` (gedcom_id, xref, tag_type, resn) VALUES (?, NULLIF(?, ''), NULLIF(?, ''), ?)"
)->execute([$WT_TREE->getTreeId(), $xref, $tag_type, $resn]);
}
}
$WT_TREE->setPreference('HIDE_LIVE_PEOPLE', Filter::postBool('HIDE_LIVE_PEOPLE'));
$WT_TREE->setPreference('KEEP_ALIVE_YEARS_BIRTH', Filter::post('KEEP_ALIVE_YEARS_BIRTH', WT_REGEX_INTEGER, 0));
$WT_TREE->setPreference('KEEP_ALIVE_YEARS_DEATH', Filter::post('KEEP_ALIVE_YEARS_DEATH', WT_REGEX_INTEGER, 0));
$WT_TREE->setPreference('MAX_ALIVE_AGE', Filter::post('MAX_ALIVE_AGE', WT_REGEX_INTEGER, 100));
$WT_TREE->setPreference('REQUIRE_AUTHENTICATION', Filter::postBool('REQUIRE_AUTHENTICATION'));
$WT_TREE->setPreference('SHOW_DEAD_PEOPLE', Filter::post('SHOW_DEAD_PEOPLE'));
$WT_TREE->setPreference('SHOW_LIVING_NAMES', Filter::post('SHOW_LIVING_NAMES'));
$WT_TREE->setPreference('SHOW_PRIVATE_RELATIONSHIPS', Filter::post('SHOW_PRIVATE_RELATIONSHIPS'));
FlashMessages::addMessage(I18N::translate('The preferences for the family tree “%s” have been updated.', $WT_TREE->getTitleHtml()), 'success');
header('Location: admin_trees_manage.php?ged=' . $WT_TREE->getNameUrl());
return;
case 'general':
if (!Filter::checkCsrf()) {
break;
}
// Coming soon
if (Filter::postBool('all_trees')) {
FlashMessages::addMessage(I18N::translate('The preferences for all family trees have been updated.', $WT_TREE->getTitleHtml()), 'success');
}
if (Filter::postBool('new_trees')) {
FlashMessages::addMessage(I18N::translate('The preferences for new family trees have been updated.', $WT_TREE->getTitleHtml()), 'success');
}
$WT_TREE->setPreference('ADVANCED_NAME_FACTS', implode(',', Filter::postArray('ADVANCED_NAME_FACTS')));
$WT_TREE->setPreference('ADVANCED_PLAC_FACTS', implode(',', Filter::postArray('ADVANCED_PLAC_FACTS')));
$WT_TREE->setPreference('ALLOW_THEME_DROPDOWN', Filter::postBool('ALLOW_THEME_DROPDOWN'));
// For backwards compatibility with webtrees 1.x we store the two calendar formats in one variable
// e.g. "gregorian_and_jewish"
$WT_TREE->setPreference('CALENDAR_FORMAT', implode('_and_', array_unique([
Filter::post('CALENDAR_FORMAT0', 'gregorian|julian|french|jewish|hijri|jalali', 'none'),
Filter::post('CALENDAR_FORMAT1', 'gregorian|julian|french|jewish|hijri|jalali', 'none'),
])));
$WT_TREE->setPreference('CHART_BOX_TAGS', Filter::post('CHART_BOX_TAGS'));
$WT_TREE->setPreference('CONTACT_USER_ID', Filter::post('CONTACT_USER_ID'));
$WT_TREE->setPreference('DEFAULT_PEDIGREE_GENERATIONS', Filter::post('DEFAULT_PEDIGREE_GENERATIONS'));
$WT_TREE->setPreference('EXPAND_NOTES', Filter::postBool('EXPAND_NOTES'));
$WT_TREE->setPreference('EXPAND_SOURCES', Filter::postBool('EXPAND_SOURCES'));
$WT_TREE->setPreference('FAM_FACTS_ADD', implode(',', Filter::postArray('FAM_FACTS_ADD')));
$WT_TREE->setPreference('FAM_FACTS_QUICK', implode(',', Filter::postArray('FAM_FACTS_QUICK')));
$WT_TREE->setPreference('FAM_FACTS_UNIQUE', implode(',', Filter::postArray('FAM_FACTS_UNIQUE')));
$WT_TREE->setPreference('FAM_ID_PREFIX', Filter::post('FAM_ID_PREFIX'));
$WT_TREE->setPreference('FULL_SOURCES', Filter::postBool('FULL_SOURCES'));
$WT_TREE->setPreference('FORMAT_TEXT', Filter::post('FORMAT_TEXT'));
$WT_TREE->setPreference('GEDCOM_ID_PREFIX', Filter::post('GEDCOM_ID_PREFIX'));
$WT_TREE->setPreference('GEDCOM_MEDIA_PATH', Filter::post('GEDCOM_MEDIA_PATH'));
$WT_TREE->setPreference('GENERATE_UIDS', Filter::postBool('GENERATE_UIDS'));
$WT_TREE->setPreference('GEONAMES_ACCOUNT', Filter::post('GEONAMES_ACCOUNT'));
$WT_TREE->setPreference('HIDE_GEDCOM_ERRORS', Filter::postBool('HIDE_GEDCOM_ERRORS'));
$WT_TREE->setPreference('INDI_FACTS_ADD', implode(',', Filter::postArray('INDI_FACTS_ADD')));
$WT_TREE->setPreference('INDI_FACTS_QUICK', implode(',', Filter::postArray('INDI_FACTS_QUICK')));
$WT_TREE->setPreference('INDI_FACTS_UNIQUE', implode(',', Filter::postArray('INDI_FACTS_UNIQUE')));
$WT_TREE->setPreference('LANGUAGE', Filter::post('LANGUAGE'));
$WT_TREE->setPreference('MAX_DESCENDANCY_GENERATIONS', Filter::post('MAX_DESCENDANCY_GENERATIONS'));
$WT_TREE->setPreference('MAX_PEDIGREE_GENERATIONS', Filter::post('MAX_PEDIGREE_GENERATIONS'));
$WT_TREE->setPreference('MEDIA_ID_PREFIX', Filter::post('MEDIA_ID_PREFIX'));
$WT_TREE->setPreference('MEDIA_UPLOAD', Filter::post('MEDIA_UPLOAD'));
$WT_TREE->setPreference('META_DESCRIPTION', Filter::post('META_DESCRIPTION'));
$WT_TREE->setPreference('META_TITLE', Filter::post('META_TITLE'));
$WT_TREE->setPreference('NOTE_ID_PREFIX', Filter::post('NOTE_ID_PREFIX'));
$WT_TREE->setPreference('NO_UPDATE_CHAN', Filter::postBool('NO_UPDATE_CHAN'));
$WT_TREE->setPreference('PEDIGREE_LAYOUT', Filter::postBool('PEDIGREE_LAYOUT'));
$WT_TREE->setPreference('PEDIGREE_ROOT_ID', Filter::post('PEDIGREE_ROOT_ID', WT_REGEX_XREF));
$WT_TREE->setPreference('PEDIGREE_SHOW_GENDER', Filter::postBool('PEDIGREE_SHOW_GENDER'));
$WT_TREE->setPreference('PREFER_LEVEL2_SOURCES', Filter::post('PREFER_LEVEL2_SOURCES'));
$WT_TREE->setPreference('QUICK_REQUIRED_FACTS', implode(',', Filter::postArray('QUICK_REQUIRED_FACTS')));
$WT_TREE->setPreference('QUICK_REQUIRED_FAMFACTS', implode(',', Filter::postArray('QUICK_REQUIRED_FAMFACTS')));
$WT_TREE->setPreference('REPO_FACTS_ADD', implode(',', Filter::postArray('REPO_FACTS_ADD')));
$WT_TREE->setPreference('REPO_FACTS_QUICK', implode(',', Filter::postArray('REPO_FACTS_QUICK')));
$WT_TREE->setPreference('REPO_FACTS_UNIQUE', implode(',', Filter::postArray('REPO_FACTS_UNIQUE')));
$WT_TREE->setPreference('REPO_ID_PREFIX', Filter::post('REPO_ID_PREFIX'));
$WT_TREE->setPreference('SHOW_COUNTER', Filter::postBool('SHOW_COUNTER'));
$WT_TREE->setPreference('SHOW_EST_LIST_DATES', Filter::postBool('SHOW_EST_LIST_DATES'));
$WT_TREE->setPreference('SHOW_FACT_ICONS', Filter::postBool('SHOW_FACT_ICONS'));
$WT_TREE->setPreference('SHOW_GEDCOM_RECORD', Filter::postBool('SHOW_GEDCOM_RECORD'));
$WT_TREE->setPreference('SHOW_HIGHLIGHT_IMAGES', Filter::postBool('SHOW_HIGHLIGHT_IMAGES'));
$WT_TREE->setPreference('SHOW_LAST_CHANGE', Filter::postBool('SHOW_LAST_CHANGE'));
$WT_TREE->setPreference('SHOW_LDS_AT_GLANCE', Filter::postBool('SHOW_LDS_AT_GLANCE'));
$WT_TREE->setPreference('SHOW_MEDIA_DOWNLOAD', Filter::post('SHOW_MEDIA_DOWNLOAD'));
$WT_TREE->setPreference('SHOW_NO_WATERMARK', Filter::post('SHOW_NO_WATERMARK'));
$WT_TREE->setPreference('SHOW_PARENTS_AGE', Filter::postBool('SHOW_PARENTS_AGE'));
$WT_TREE->setPreference('SHOW_PEDIGREE_PLACES', Filter::post('SHOW_PEDIGREE_PLACES'));
$WT_TREE->setPreference('SHOW_PEDIGREE_PLACES_SUFFIX', Filter::postBool('SHOW_PEDIGREE_PLACES_SUFFIX'));
$WT_TREE->setPreference('SHOW_RELATIVES_EVENTS', implode(',', Filter::postArray('SHOW_RELATIVES_EVENTS')));
$WT_TREE->setPreference('SOURCE_ID_PREFIX', Filter::post('SOURCE_ID_PREFIX'));
$WT_TREE->setPreference('SOUR_FACTS_ADD', implode(',', Filter::postArray('SOUR_FACTS_ADD')));
$WT_TREE->setPreference('SOUR_FACTS_QUICK', implode(',', Filter::postArray('SOUR_FACTS_QUICK')));
$WT_TREE->setPreference('SOUR_FACTS_UNIQUE', implode(',', Filter::postArray('SOUR_FACTS_UNIQUE')));
$WT_TREE->setPreference('SUBLIST_TRIGGER_I', Filter::post('SUBLIST_TRIGGER_I', WT_REGEX_INTEGER, 200));
$WT_TREE->setPreference('SURNAME_LIST_STYLE', Filter::post('SURNAME_LIST_STYLE'));
$WT_TREE->setPreference('SURNAME_TRADITION', Filter::post('SURNAME_TRADITION'));
$WT_TREE->setPreference('THEME_DIR', Filter::post('THEME_DIR'));
$WT_TREE->setPreference('USE_SILHOUETTE', Filter::postBool('USE_SILHOUETTE'));
$WT_TREE->setPreference('WEBMASTER_USER_ID', Filter::post('WEBMASTER_USER_ID'));
$WT_TREE->setPreference('WEBTREES_EMAIL', Filter::post('WEBTREES_EMAIL'));
$WT_TREE->setPreference('title', Filter::post('title'));
// Only accept valid folders for MEDIA_DIRECTORY
$MEDIA_DIRECTORY = preg_replace('/[\/\\\\]+/', '/', Filter::post('MEDIA_DIRECTORY') . '/');
if (substr($MEDIA_DIRECTORY, 0, 1) === '/') {
$MEDIA_DIRECTORY = substr($MEDIA_DIRECTORY, 1);
}
if ($MEDIA_DIRECTORY) {
if (is_dir(WT_DATA_DIR . $MEDIA_DIRECTORY)) {
$WT_TREE->setPreference('MEDIA_DIRECTORY', $MEDIA_DIRECTORY);
} elseif (File::mkdir(WT_DATA_DIR . $MEDIA_DIRECTORY)) {
$WT_TREE->setPreference('MEDIA_DIRECTORY', $MEDIA_DIRECTORY);
FlashMessages::addMessage(I18N::translate('The folder %s has been created.', Html::filename(WT_DATA_DIR . $MEDIA_DIRECTORY)), 'info');
} else {
FlashMessages::addMessage(I18N::translate('The folder %s does not exist, and it could not be created.', Html::filename(WT_DATA_DIR . $MEDIA_DIRECTORY)), 'danger');
}
}
$gedcom = Filter::post('gedcom');
if ($gedcom && $gedcom !== $WT_TREE->getName()) {
try {
Database::prepare("UPDATE `##gedcom` SET gedcom_name = ? WHERE gedcom_id = ?")->execute([$gedcom, $WT_TREE->getTreeId()]);
Database::prepare("UPDATE `##site_setting` SET setting_value = ? WHERE setting_name='DEFAULT_GEDCOM' AND setting_value = ?")->execute([$gedcom, $WT_TREE->getName()]);
} catch (\Exception $ex) {
// Probably a duplicate name.
}
}
FlashMessages::addMessage(I18N::translate('The preferences for the family tree “%s” have been updated.', $WT_TREE->getTitleHtml()), 'success');
header('Location: admin_trees_manage.php');
return;
}
switch (Filter::get('action')) {
case 'privacy':
$controller
->setPageTitle($WT_TREE->getTitleHtml() . ' — ' . I18N::translate('Privacy'))
->addInlineJavascript('
$("#default-resn input[type=checkbox]").on("click", function() {
if ($(this).prop("checked")) {
$($(this).closest("tr").addClass("text-muted"));
} else {
$($(this).closest("tr").removeClass("text-muted"));
}
});
$("#add-resn").on("click", function() {
$("#default-resn tbody").prepend($("#new-resn-template").html());
});
');
break;
case 'general':
$controller->setPageTitle($WT_TREE->getTitleHtml() . ' — ' . I18N::translate('Preferences'));
break;
default:
header('Location: ' . route('admin-control-panel'));
return;
}
$controller
->pageHeader()
->addExternalJavascript(WT_ADMIN_JS_URL);
echo Bootstrap4::breadcrumbs([
route('admin-control-panel') => I18N::translate('Control panel'),
'admin_trees_manage.php' => I18N::translate('Manage family trees'),
], $controller->getPageTitle());
?>
<h1><?= $controller->getPageTitle() ?></h1>
<form class="form-horizontal" method="post">
<?= Filter::getCsrf() ?>
<input type="hidden" name="ged" value="<?= $WT_TREE->getNameHtml() ?>">
<?php if (Filter::get('action') === 'privacy'): ?>
<input type="hidden" name="action" value="privacy">
<!-- REQUIRE_AUTHENTICATION -->
<div class="row form-group">
<div class="col-form-label col-sm-4">
<label>
<?= /* I18N: A configuration setting */ I18N::translate('Show the family tree') ?>
</label>
<div class="hidden-xs">
<span class="badge visitors"><i class="fa fa-fw"></i> <?= I18N::translate('visitors') ?></span>
<span class="badge members"><i class="fa fa-fw"></i><?= I18N::translate('members') ?></span>
</div>
</div>
<div class="col-sm-8">
<?= Bootstrap4::select(['0' => I18N::translate('Show to visitors'), '1' => I18N::translate('Show to members')], $WT_TREE->getPreference('REQUIRE_AUTHENTICATION'), ['id' => 'REQUIRE_AUTHENTICATION', 'name' => 'REQUIRE_AUTHENTICATION']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Family tree” configuration setting */ I18N::translate('Enabling this option will force all visitors to sign in before they can view any data on the website.') ?>
</p>
<?php if (Site::getPreference('USE_REGISTRATION_MODULE') === '1'): ?>
<p class="small text-muted">
<?= I18N::translate('If visitors can not see the family tree, they will not be able to sign up for an account. You will need to add their account manually.') ?>
</p>
<?php endif ?>
</div>
</div>
<!-- SHOW_DEAD_PEOPLE -->
<div class="row form-group">
<div class="col-form-label col-sm-4">
<label for="SHOW_DEAD_PEOPLE">
<?= /* I18N: A configuration setting */ I18N::translate('Show dead individuals') ?>
</label>
<div class="hidden-xs">
<span class="badge visitors"><i class="fa fa-fw"></i> <?= I18N::translate('visitors') ?></span>
<span class="badge members"><i class="fa fa-fw"></i><?= I18N::translate('members') ?></span>
</div>
</div>
<div class="col-sm-8">
<?= Bootstrap4::select(array_slice(FunctionsEdit::optionsAccessLevels(), 0, 2, true), $WT_TREE->getPreference('SHOW_DEAD_PEOPLE'), ['id' => 'SHOW_DEAD_PEOPLE', 'name' => 'SHOW_DEAD_PEOPLE']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Show dead individuals” configuration setting */ I18N::translate('Set the privacy access level for all dead individuals.') ?>
</p>
</div>
</div>
<!-- MAX_ALIVE_AGE -->
<div class="row form-group">
<label class="col-form-label col-sm-4" for="MAX_ALIVE_AGE">
<?= I18N::translate('Age at which to assume an individual is dead') ?>
</label>
<div class="col-sm-8">
<input
class="form-control"
id="MAX_ALIVE_AGE"
maxlength="5"
name="MAX_ALIVE_AGE"
type="text"
value="<?= Html::escape($WT_TREE->getPreference('MAX_ALIVE_AGE')) ?>"
>
<p class="small text-muted">
<?= /* I18N: Help text for the “Age at which to assume an individual is dead” configuration setting */ I18N::translate('If this individual has any events other than death, burial, or cremation more recent than this number of years, they are considered to be “alive”. Children’s birth dates are considered to be such events for this purpose.') ?>
</p>
</div>
</div>
<!-- HIDE_LIVE_PEOPLE -->
<fieldset class="form-group">
<div class="row">
<div class="col-sm-4">
<legend class="col-form-legend">
<?= /* I18N: A configuration setting */ I18N::translate('Show living individuals') ?>
<div class="hidden-xs">
<span class="badge visitors"><i class="fa fa-fw"></i> <?= I18N::translate('visitors') ?></span>
<span class="badge members"><i class="fa fa-fw"></i><?= I18N::translate('members') ?></span>
</div>
</legend>
</div>
<div class="col-sm-8">
<?= Bootstrap4::select(['0' => I18N::translate('Show to visitors'), '1' => I18N::translate('Show to members')], $WT_TREE->getPreference('HIDE_LIVE_PEOPLE'), ['id' => 'HIDE_LIVE_PEOPLE', 'name' => 'HIDE_LIVE_PEOPLE']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Show living individuals” configuration setting */ I18N::translate('If you show living individuals to visitors, all other privacy restrictions are ignored. Do this only if all the data in your tree is public.') ?>
</p>
</div>
</div>
</fieldset>
<!-- KEEP_ALIVE_YEARS_BIRTH / KEEP_ALIVE_YEARS_DEATH -->
<fieldset class="form-group">
<div class="row">
<legend class="col-form-legend col-sm-4">
<?= /* I18N: A configuration setting. …who were born in the last XX years or died in the last YY years */ I18N::translate('Extend privacy to dead individuals') ?>
</legend>
<div class="col-sm-8">
<?php
echo
/* I18N: Extend privacy to dead individuals who were… */ I18N::translate(
'born in the last %1$s years or died in the last %2$s years',
'<input type="text" name="KEEP_ALIVE_YEARS_BIRTH" value="' . $WT_TREE->getPreference('KEEP_ALIVE_YEARS_BIRTH') . '" size="5" maxlength="3">',
'<input type="text" name="KEEP_ALIVE_YEARS_DEATH" value="' . $WT_TREE->getPreference('KEEP_ALIVE_YEARS_DEATH') . '" size="5" maxlength="3">'
) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Extend privacy to dead individuals” configuration setting */ I18N::translate('In some countries, privacy laws apply not only to living individuals, but also to those who have died recently. This option will allow you to extend the privacy rules for living individuals to those who were born or died within a specified number of years. Leave these values empty to disable this feature.') ?>
</p>
</div>
</div>
</fieldset>
<!-- SHOW_LIVING_NAMES -->
<div class="row form-group">
<div class="col-form-label col-sm-4">
<label for="SHOW_LIVING_NAMES">
<?= /* I18N: A configuration setting */ I18N::translate('Show names of private individuals') ?>
</label>
<div class="hidden-xs">
<span class="badge visitors"><i class="fa fa-fw"></i> <?= I18N::translate('visitors') ?></span>
<span class="badge members"><i class="fa fa-fw"></i><?= I18N::translate('members') ?></span>
<span class="badge managers"><i class="fa fa-fw"></i> <?= I18N::translate('managers') ?></span>
</div>
</div>
<div class="col-sm-8">
<?= Bootstrap4::select(array_slice(FunctionsEdit::optionsAccessLevels(), 0, 3, true), $WT_TREE->getPreference('SHOW_LIVING_NAMES'), ['id' => 'SHOW_LIVING_NAMES', 'name' => 'SHOW_LIVING_NAMES']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Show names of private individuals” configuration setting */ I18N::translate('This option will show the names (but no other details) of private individuals. Individuals are private if they are still alive or if a privacy restriction has been added to their individual record. To hide a specific name, add a privacy restriction to that name record.') ?>
</p>
</div>
</div>
<!-- SHOW_PRIVATE_RELATIONSHIPS -->
<div class="row form-group">
<div class="col-form-label col-sm-4">
<label for="SHOW_PRIVATE_RELATIONSHIPS">
<?= /* I18N: A configuration setting */ I18N::translate('Show private relationships') ?>
</label>
<div class="hidden-xs">
<span class="badge visitors"><i class="fa fa-fw"></i> <?= I18N::translate('visitors') ?></span>
<span class="badge members"><i class="fa fa-fw"></i><?= I18N::translate('members') ?></span>
</div>
</div>
<div class="col-sm-8">
<?= Bootstrap4::select(['0' => I18N::translate('Hide from everyone'), '1' => I18N::translate('Show to visitors')], $WT_TREE->getPreference('SHOW_PRIVATE_RELATIONSHIPS'), ['id' => 'SHOW_PRIVATE_RELATIONSHIPS', 'name' => 'SHOW_PRIVATE_RELATIONSHIPS']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Show private relationships” configuration setting */ I18N::translate('This option will retain family links in private records. This means that you will see empty “private” boxes on the pedigree chart and on other charts with private individuals.') ?>
</p>
</div>
</div>
<h2><?= /* I18N: Privacy restrictions are set by RESN tags in GEDCOM. */ I18N::translate('Privacy restrictions') ?></h2>
<p>
<?= /* I18N: Privacy restrictions are RESN tags in GEDCOM. */ I18N::translate('You can set the access for a specific record, fact, or event by adding a restriction to it. If a record, fact, or event does not have a restriction, the following default restrictions will be used.') ?>
</p>
<script id="new-resn-template" type="text/html">
<tr>
<td>
<input data-autocomplete-type="IFSRO" id="xref" maxlength="20" name="xref[]" type="text">
</td>
<td>
<?= Bootstrap4::select($all_tags, '', ['name' => 'tag_type[]']) ?>
</td>
<td>
<?= Bootstrap4::select($PRIVACY_CONSTANTS, 'privacy', ['name' => 'resn[]']) ?>
</td>
<td>
</td>
</tr>
</script>
<table class="table table-bordered table-sm table-hover" id="default-resn">
<caption class="sr-only">
<?= I18N::translate('Privacy restrictions - these apply to records and facts that do not contain a GEDCOM RESN tag') ?>
</caption>
<thead>
<tr>
<th>
<?= I18N::translate('Record') ?>
</th>
<th>
<?= I18N::translate('Fact or event') ?>
</th>
<th>
<?= I18N::translate('Access level') ?>
</th>
<th>
<button class="btn btn-primary" id="add-resn" type="button">
<i class="fa fa-plus"></i>
<?= /* I18N: A button label. */ I18N::translate('add') ?>
</button>
</th>
</tr>
</thead>
<tbody>
<?php foreach ($resns as $resn): ?>
<tr>
<td>
<?php if ($resn->record): ?>
<a href="<?= $resn->record->getHtmlUrl() ?>"><?= $resn->record->getFullName() ?></a>
<?php elseif ($resn->xref): ?>
<div class="bg-danger text-danger">
<?= $resn->xref ?> — <?= I18N::translate('this record does not exist') ?>
</div>
<?php else: ?>
<div class="text-muted">
<?= I18N::translate('All records') ?>
</div>
<?php endif ?>
</td>
<td>
<?php if ($resn->tag_label): ?>
<?= $resn->tag_label ?>
<?php else: ?>
<div class="text-muted">
<?= I18N::translate('All facts and events') ?>
</div>
<?php endif ?>
</td>
<td>
<?= FunctionsEdit::optionsRestrictions(false)[$resn->resn] ?>
</td>
<td>
<label for="delete-<?= $resn->default_resn_id ?>">
<input id="delete-<?= $resn->default_resn_id ?>" name="delete[]" type="checkbox" value="<?= $resn->default_resn_id ?>">
<?= I18N::translate('Delete') ?>
</label>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php elseif (Filter::get('action') === 'general'): ?>
<input type="hidden" name="action" value="general">
<h3><?= I18N::translate('General') ?></h3>
<!-- TREE TITLE -->
<div class="row form-group">
<label class="col-sm-3 col-form-label" for="title">
<?= I18N::translate('Family tree title') ?>
</label>
<div class="col-sm-9">
<input
class="form-control"
dir="auto"
id="title"
maxlength="255"
name="title"
required
type="text"
value="<?= Html::escape($WT_TREE->getPreference('title')) ?>"
>
</div>
</div>
<!-- TREE URL / FILENAME -->
<div class="row form-group">
<label class="col-sm-3 col-form-label" for="gedcom">
<?= I18N::translate('URL') ?>
</label>
<div class="col-sm-9">
<div class="input-group">
<span class="input-group-addon" dir="ltr">
<?= WT_BASE_URL ?>?ged=
</span>
<input
class="form-control"
id="gedcom"
maxlength="255"
name="gedcom"
required
type="text"
value="<?= $WT_TREE->getNameHtml() ?>"
>
</div>
<p class="small text-muted">
<?= /* I18N: help text for family tree / GEDCOM file names */ I18N::translate('Avoid spaces and punctuation. A family name might be a good choice.') ?>
</p>
</div>
</div>
<!-- LANGUAGE -->
<div class="row form-group">
<label class="col-sm-3 col-form-label" for="LANGUAGE">
<?= /* I18N: A configuration setting */ I18N::translate('Language') ?>
</label>
<div class="col-sm-9">
<select id="LANGUAGE" name="LANGUAGE" class="form-control">
<?php foreach (I18N::activeLocales() as $active_locale): ?>
<option value="<?= $active_locale->languageTag() ?>" <?= $WT_TREE->getPreference('LANGUAGE') === $active_locale->languageTag() ? 'selected' : '' ?>>
<?= $active_locale->endonym() ?>
</option>
<?php endforeach ?>
</select>
<p class="small text-muted">
<?= /* I18N: Help text for the “Language” configuration setting */ I18N::translate('If a visitor to the website has not selected a preferred language in their browser preferences, or they have selected an unsupported language, then this language will be used. Typically this applies to search engines.') ?>
</p>
</div>
</div>
<!-- PEDIGREE_ROOT_ID -->
<div class="row form-group">
<label class="col-sm-3 col-form-label" for="PEDIGREE_ROOT_ID">
<?= /* I18N: A configuration setting */ I18N::translate('Default individual') ?>
</label>
<div class="col-sm-9">
<?= FunctionsEdit::formControlIndividual(Individual::getInstance($WT_TREE->getPreference('PEDIGREE_ROOT_ID'), $WT_TREE), ['id' => 'PEDIGREE_ROOT_ID', 'name' => 'PEDIGREE_ROOT_ID']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Default individual” configuration setting */ I18N::translate('This individual will be selected by default when viewing charts and reports.') ?>
</p>
</div>
</div>
<!-- CALENDAR_FORMAT -->
<fieldset class="form-group">
<div class="row">
<legend class="col-form-legend col-sm-3">
<?= /* I18N: A configuration setting */ I18N::translate('Calendar conversion') ?>
<label class="sr-only" for="CALENDAR_FORMAT0">
<?= /* I18N: A configuration setting */ I18N::translate('Calendar conversion') ?> 1
</label>
<label class="sr-only" for="CALENDAR_FORMAT1">
<?= /* I18N: A configuration setting */ I18N::translate('Calendar conversion') ?> 2
</label>
</legend>
<div class="col-sm-9">
<div class=row">
<div class="col-sm-6" style="padding-left: 0;">
<?= Bootstrap4::select(FunctionsEdit::optionsCalendarConversions(), $CALENDAR_FORMATS[0], ['name' => 'CALENDAR_FORMAT0']) ?>
</div>
<div class="col-sm-6" style="padding-right: 0;">
<?= Bootstrap4::select(FunctionsEdit::optionsCalendarConversions(), $CALENDAR_FORMATS[1], ['name' => 'CALENDAR_FORMAT1']) ?>
</div>
</div>
<p class="small text-muted">
<?= /* 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.') ?>
</p>
<p class="small text-muted">
<?= /* 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(false, null, false), $french_calendar_end->display(false, null, false), $gregorian_calendar_start->display(false, null, false)) ?>
</p>
<p class="small text-muted">
<?= /* 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.') ?>
</p>
</div>
</div>
</fieldset>
<!-- GENERATE_UIDS -->
<fieldset class="form-group">
<div class="row">
<legend class="col-form-legend col-sm-3">
<?= /* I18N: A configuration setting */ I18N::translate('Add unique identifiers') ?>
</legend>
<div class="col-sm-9">
<?= Bootstrap4::radioButtons('GENERATE_UIDS', FunctionsEdit::optionsNoYes(), $WT_TREE->getPreference('GENERATE_UIDS'), true) ?>
<p class="small text-muted">
<?= /* 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.') ?>
</p>
</div>
</div>
</fieldset>
<!-- XXXXX_ID_PREFIX -->
<fieldset class="form-group">
<div class="row>"
<legend class="col-form-legend col-sm-3">
<?= /* I18N: A configuration setting. The first letter(s) in a GEDCOM identifier. */ I18N::translate('XREF prefixes') ?>
</legend>
<div class="col-sm-9">
<div class="row">
<!-- GEDCOM_ID_PREFIX -->
<div class="col-sm-6 col-md-4">
<div class="input-group">
<label class="input-group-addon" for="GEDCOM_ID_PREFIX">
<?= I18N::translate('Individual') ?>
</label>
<input
class="form-control"
dir="ltr"
id="GEDCOM_ID_PREFIX"
maxlength="10"
name="GEDCOM_ID_PREFIX"
type="text"
value="<?= $WT_TREE->getPreference('GEDCOM_ID_PREFIX') ?>"
>
</div>
</div>
<!-- FAM_ID_PREFIX -->
<div class="col-sm-6 col-md-4">
<div class="input-group">
<label class="input-group-addon" for="FAM_ID_PREFIX">
<?= I18N::translate('Family') ?>
</label>
<input
class="form-control"
dir="ltr"
id="FAM_ID_PREFIX"
maxlength="10"
name="FAM_ID_PREFIX"
type="text"
value="<?= $WT_TREE->getPreference('FAM_ID_PREFIX') ?>"
>
</div>
</div>
<!-- SOURCE_ID_PREFIX -->
<div class="col-sm-6 col-md-4">
<div class="input-group">
<label class="input-group-addon" for="SOURCE_ID_PREFIX">
<?= I18N::translate('Source') ?>
</label>
<input
class="form-control"
dir="ltr"
id="SOURCE_ID_PREFIX"
maxlength="10"
name="SOURCE_ID_PREFIX"
type="text"
value="<?= $WT_TREE->getPreference('SOURCE_ID_PREFIX') ?>"
>
</div>
</div>
<!-- REPO_ID_PREFIX -->
<div class="col-sm-6 col-md-4">
<div class="input-group">
<label class="input-group-addon" for="REPO_ID_PREFIX">
<?= I18N::translate('Repository') ?>
</label>
<input
class="form-control"
dir="ltr"
id="REPO_ID_PREFIX"
maxlength="10"
name="REPO_ID_PREFIX"
type="text"
value="<?= $WT_TREE->getPreference('REPO_ID_PREFIX') ?>"
>
</div>
</div>
<!-- MEDIA_ID_PREFIX -->
<div class="col-sm-6 col-md-4">
<div class="input-group">
<label class="input-group-addon" for="MEDIA_ID_PREFIX">
<?= I18N::translate('Media object') ?>
</label>
<input
class="form-control"
dir="ltr"
id="MEDIA_ID_PREFIX"
maxlength="10"
name="MEDIA_ID_PREFIX"
type="text"
value="<?= $WT_TREE->getPreference('MEDIA_ID_PREFIX') ?>"
>
</div>
</div>
<!-- NOTE_ID_PREFIX -->
<div class="col-sm-6 col-md-4">
<div class="input-group">
<label class="input-group-addon" for="NOTE_ID_PREFIX">
<?= I18N::translate('Note') ?>
</label>
<input
class="form-control"
dir="ltr"
id="NOTE_ID_PREFIX"
maxlength="10"
name="NOTE_ID_PREFIX"
type="text"
value="<?= $WT_TREE->getPreference('NOTE_ID_PREFIX') ?>"
>
</div>
</div>
</div>
<p class="small text-muted">
<?= I18N::translate('In a family tree, each record has an internal reference number (called an “XREF”) such as “F123” or “R14”.') ?>
<?= /* I18N: An XREF is the identification number used in GEDCOM files, such as F123 or R14. */ I18N::translate('You can choose the prefix that will be used whenever new XREFs are created.') ?>
</p>
</div>
</fieldset>
<h3><?= I18N::translate('Contact information') ?></h3>
<!-- WEBTREES_EMAIL -->
<div class="row form-group">
<label class="col-sm-3 col-form-label" for="WEBTREES_EMAIL">
<?= /* I18N: A configuration setting */ I18N::translate('webtrees reply address') ?>
</label>
<div class="col-sm-9">
<input
class="form-control"
id="WEBTREES_EMAIL"
maxlength="255"
name="WEBTREES_EMAIL"
required
type="email"
value="<?= Html::escape($WT_TREE->getPreference('WEBTREES_EMAIL')) ?>"
>
<p class="small text-muted">
<?= /* I18N: Help text for the “webtrees reply address” configuration setting */ I18N::translate('Email address to be used in the “From:” field of emails that webtrees creates automatically.<br><br>webtrees can automatically create emails to notify administrators of changes that need to be reviewed. webtrees also sends notification emails to users who have requested an account.<br><br>Usually, the “From:” field of these automatically created emails is something like <i>From: webtrees-noreply@yoursite</i> to show that no response to the email is required. To guard against spam or other email abuse, some email systems require each message’s “From:” field to reflect a valid email account and will not accept messages that are apparently from account <i>webtrees-noreply</i>.') ?>
</p>
</div>
</div>
<!-- CONTACT_USER_ID -->
<div class="row form-group">
<label class="col-sm-3 col-form-label" for="CONTACT_USER_ID">
<?= /* I18N: A configuration setting */ I18N::translate('Genealogy contact') ?>
</label>
<div class="col-sm-9">
<select id="CONTACT_USER_ID" name="CONTACT_USER_ID" class="form-control">
<option value=""></option>
<?php foreach (User::all() as $user): ?>
<?php if (Auth::isMember($WT_TREE, $user)): ?>
<option value="<?= $user->getUserId() ?>" <?= $WT_TREE->getPreference('CONTACT_USER_ID') === $user->getUserId() ? 'selected' : '' ?>>
<?= $user->getRealNameHtml() ?> - <?= Html::escape($user->getUserName()) ?>
</option>
<?php endif ?>
<?php endforeach ?>
</select>
<p class="small text-muted">
<?= /* I18N: Help text for the “Genealogy contact” configuration setting */ I18N::translate('The individual to contact about the genealogy data on this website.') ?>
</p>
</div>
</div>
<!-- WEBMASTER_USER_ID -->
<div class="row form-group">
<label class="col-sm-3 col-form-label" for="WEBMASTER_USER_ID">
<?= /* I18N: A configuration setting */ I18N::translate('Technical help contact') ?>
</label>
<div class="col-sm-9">
<select id="WEBMASTER_USER_ID" name="WEBMASTER_USER_ID" class="form-control">
<option value=""></option>
<?php foreach (User::all() as $user): ?>
<?php if (Auth::isMember($WT_TREE, $user)): ?>
<option value="<?= $user->getUserId() ?>" <?= $WT_TREE->getPreference('WEBMASTER_USER_ID') === $user->getUserId() ? 'selected' : '' ?>>
<?= $user->getRealNameHtml() ?> - <?= Html::escape($user->getUserName()) ?>
</option>
<?php endif ?>
<?php endforeach ?>
</select>
<p class="small text-muted">
<?= /* 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.') ?>
</p>
</div>
</div>
<h3><?= I18N::translate('Website') ?></h3>
<!-- META_TITLE -->
<div class="row form-group">
<label class="col-sm-3 col-form-label" for="META_TITLE">
<?= /* I18N: A configuration setting */ I18N::translate('Add to TITLE header tag') ?>
</label>
<div class="col-sm-9">
<input
class="form-control"
id="META_TITLE"
maxlength="255"
name="META_TITLE"
type="text"
value="<?= Html::escape($WT_TREE->getPreference('META_TITLE')) ?>"
>
<p class="small text-muted">
<?= /* 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.') ?>
</p>
</div>
</div>
<!-- META_DESCRIPTION -->
<div class="row form-group">
<label class="col-sm-3 col-form-label" for="META_DESCRIPTION">
<?= /* I18N: A configuration setting */ I18N::translate('Description META tag') ?>
</label>
<div class="col-sm-9">
<input
class="form-control"
id="META_DESCRIPTION"
maxlength="255"
name="META_DESCRIPTION"
type="text"
value="<?= Html::escape($WT_TREE->getPreference('META_DESCRIPTION')) ?>"
>
<p class="small text-muted">
<?= /* I18N: Help text for the “Description META tag” configuration setting */ I18N::translate('The value to place in the “meta description” tag in the HTML page header. Leave this field empty to use the name of the family tree.') ?>
</p>
</div>
</div>
<h3><?= I18N::translate('User preferences') ?></h3>
<!-- ALLOW_THEME_DROPDOWN -->
<fieldset class="form-group">
<div class="row">
<legend class="col-form-legend col-sm-3">
<?= /* I18N: A configuration setting */ I18N::translate('Theme menu') ?>
</legend>
<div class="col-sm-9">
<?= Bootstrap4::radioButtons('ALLOW_THEME_DROPDOWN', FunctionsEdit::optionsHideShow(), $WT_TREE->getPreference('ALLOW_THEME_DROPDOWN'), true) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Theme dropdown selector for theme changes” configuration setting */ I18N::translate('The theme menu will only be shown if the website preferences allow users to select their own theme.') ?>
</p>
</div>
</div>
</fieldset>
<!-- THEME_DIR -->
<div class="row form-group">
<label class="col-sm-3 col-form-label" for="THEME_DIR">
<?= /* I18N: A configuration setting */ I18N::translate('Default theme') ?>
</label>
<div class="col-sm-9">
<?= Bootstrap4::select($THEME_OPTIONS, $WT_TREE->getPreference('THEME_DIR'), ['id' => 'THEME_DIR', 'name' => 'THEME_DIR']) ?>
<p class="small text-muted">
<?= /* I18N: Help text for the “Default theme” configuration setting */ I18N::translate('You can change the appearance of webtrees using “themes”. Each theme has a different style, layout, color scheme, etc.') ?>
</p>
</div>
</div>
<h3><?= I18N::translate('Media folders') ?></h3>
<!-- MEDIA_DIRECTORY -->
<div class="row form-group">
<label class="col-sm-3 col-form-label" for="MEDIA_DIRECTORY">
<?= /* I18N: A configuration setting */ I18N::translate('Media folder') ?>
</label>
<div class="col-sm-9">
<div class="input-group">
<span class="input-group-addon">
<?= WT_DATA_DIR ?>
</span>
<input
class="form-control"
dir="ltr"
id="MEDIA_DIRECTORY"
maxlength="255"
name="MEDIA_DIRECTORY"
type="text"
value="<?= Html::escape($WT_TREE->getPreference('MEDIA_DIRECTORY')) ?>"
>
</div>
<p class="small text-muted">
<?= /* 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.') ?>
<?= /* 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.') ?>
<?= /* 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.') ?>
</p>
</div>
</div>
<h3><?= I18N::translate('Media files') ?></h3>
<!-- MEDIA_UPLOAD -->
<div class="row form-group">
<label class="col-sm-3 col-form-label" for="MEDIA_UPLOAD">
<?= /* I18N: A configuration setting */ I18N::translate('Who can upload new media files') ?>
</label>
<div class="col-sm-9">
<?= Bootstrap4::select([Auth::PRIV_USER => I18N::translate('Show to members'), Auth::PRIV_NONE => I18N::translate('Show to managers'), Auth::PRIV_HIDE => I18N::translate('Hide from everyone')], $WT_TREE->getPreference('MEDIA_UPLOAD'), ['id' => 'MEDIA_UPLOAD', 'name' => 'MEDIA_UPLOAD']) ?>
<p class="small text-muted">
<?= /* 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.') ?>
</p>
</div>
</div>
<!-- SHOW_MEDIA_DOWNLOAD -->
<fieldset class="form-group">
<div class="row">
<legend class="col-form-legend col-sm-3">
<?= /* I18N: A configuration setting */ I18N::translate('Show a download link in the media viewer') ?>
</legend>
<div class="col-sm-9">
<?= Bootstrap4::select(FunctionsEdit::optionsAccessLevels(), $WT_TREE->getPreference('SHOW_MEDIA_DOWNLOAD'), ['id' => 'SHOW_MEDIA_DOWNLOAD', 'name' => 'SHOW_MEDIA_DOWNLOAD']) ?>
<p class="small text-muted">
<?= /* 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.') ?>
</p>
</div>
</div>
</fieldset>
<h3><?= I18N::translate('Thumbnail images') ?></h3>
<!-- SHOW_HIGHLIGHT_IMAGES -->
<fieldset class="form-group">