xref: /webtrees/resources/views/admin/site-preferences.phtml (revision 9a8145f87c5347b68b1b79bd375d829fd52c77d3)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
4use Fisharebest\Webtrees\Http\RequestHandlers\SitePreferencesAction;
5use Fisharebest\Webtrees\I18N;
6use Fisharebest\Webtrees\Site;
7
8/**
9 * @var array<string> $all_themes
10 * @var string        $title
11 */
12
13?>
14
15<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), $title]]) ?>
16
17<h1><?= $title ?></h1>
18
19<form method="post" action="<?= e(route(SitePreferencesAction::class)) ?>" class="form-horizontal">
20    <!-- INDEX_DIRECTORY -->
21    <div class="row mb-3">
22        <label for="INDEX_DIRECTORY" class="col-sm-3 col-form-label">
23            <?= /* I18N: A configuration setting */
24            I18N::translate('Data folder') ?>
25        </label>
26        <div class="col-sm-9">
27            <input type="text" class="form-control" dir="ltr" id="INDEX_DIRECTORY" name="INDEX_DIRECTORY" value="<?= e(Site::getPreference('INDEX_DIRECTORY')) ?>" maxlength="255" placeholder="data/" required="required">
28            <div class="form-text">
29                <?= /* I18N: Help text for the "Data folder" site configuration setting */
30                I18N::translate('This folder will be used by webtrees to store media files, GEDCOM files, temporary files, etc. These files may contain private data, and should not be made available over the internet.') ?>
31            </div>
32            <div class="form-text">
33                <?= /* I18N: “Apache” is a software program. */
34                I18N::translate('To protect this private data, webtrees uses an Apache configuration file (.htaccess) which blocks all access to this folder. If your web-server does not support .htaccess files, and you cannot restrict access to this folder, then you can select another folder, away from your web documents.') ?>
35            </div>
36            <div class="form-text">
37                <?= I18N::translate('If you select a different folder, you must also move all files (except config.ini.php, index.php, and .htaccess) from the existing folder to the new folder.') ?>
38            </div>
39            <div class="form-text">
40                <?= I18N::translate('The folder can be specified in full (e.g. /home/user_name/webtrees_data/) or relative to the installation folder (e.g. ../../webtrees_data/).') ?>
41            </div>
42        </div>
43    </div>
44
45    <!-- TIMEZONE -->
46    <div class="row mb-3">
47        <label for="TIMEZONE" class="col-sm-3 col-form-label">
48            <?= I18N::translate('Time zone') ?>
49        </label>
50        <div class="col-sm-9">
51            <?= view('components/select', ['name' => 'TIMEZONE', 'selected' => Site::getPreference('TIMEZONE'), 'options' => array_combine(DateTimeZone::listIdentifiers(), DateTimeZone::listIdentifiers())]) ?>
52            <div class="form-text">
53                <?= I18N::translate('The time zone is required for date calculations, such as knowing today’s date.') ?>
54            </div>
55        </div>
56    </div>
57
58    <!-- THEME_DIR -->
59    <div class="row mb-3">
60        <label for="THEME_DIR" class="col-sm-3 col-form-label">
61            <?= /* I18N: A configuration setting */
62            I18N::translate('Default theme') ?>
63        </label>
64        <div class="col-sm-9">
65            <?= view('components/select', ['name' => 'THEME_DIR', 'selected' => Site::getPreference('THEME_DIR'), 'options' => $all_themes]) ?>
66            <div class="form-text">
67                <?= /* I18N: Help text for the "Default theme" site configuration setting */
68                I18N::translate('You can change the appearance of webtrees using “themes”. Each theme has a different style, layout, color scheme, etc.') ?>
69            </div>
70        </div>
71    </div>
72
73    <!-- LANGUAGE -->
74    <div class="row mb-3">
75        <label class="col-sm-3 col-form-label" for="LANGUAGE">
76            <?= /* I18N: A configuration setting */ I18N::translate('Language') ?>
77        </label>
78        <div class="col-sm-9">
79            <select id="LANGUAGE" name="LANGUAGE" class="form-select">
80                <?php foreach (I18N::activeLocales() as $active_locale) : ?>
81                    <option value="<?= $active_locale->languageTag() ?>" <?= Site::getPreference('LANGUAGE') === $active_locale->languageTag() ? 'selected' : '' ?>>
82                        <?= $active_locale->endonym() ?>
83                    </option>
84                <?php endforeach ?>
85            </select>
86            <div class="form-text">
87                <?= /* 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.') ?>
88            </div>
89        </div>
90    </div>
91
92    <!-- ALLOW_CHANGE_GEDCOM -->
93    <fieldset class="row mb-3">
94        <legend class="col-form-label col-sm-3">
95            <?= /* I18N: A configuration setting */
96            I18N::translate('Show list of family trees') ?>
97        </legend>
98        <div class="col-sm-9">
99            <?= view('components/radios-inline', ['name' => 'ALLOW_CHANGE_GEDCOM', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) Site::getPreference('ALLOW_CHANGE_GEDCOM')]) ?>
100            <div class="form-text">
101                <?= /* I18N: Help text for the “Show list of family trees” site configuration setting */
102                I18N::translate('For websites with more than one family tree, this option will show the list of family trees in the main menu, the search pages, etc.') ?>
103            </div>
104        </div>
105    </fieldset>
106
107    <div class="row mb-3">
108        <div class="offset-sm-3 col-sm-9">
109            <button type="submit" class="btn btn-primary">
110                <?= view('icons/save') ?>
111                <?= I18N::translate('save') ?>
112            </button>
113
114            <a href="<?= e(route(ControlPanel::class)) ?>" class="btn btn-secondary">
115                <?= view('icons/cancel') ?>
116                <?= I18N::translate('cancel') ?>
117            </a>
118        </div>
119    </div>
120
121    <?= csrf_field() ?>
122</form>
123