xref: /webtrees/resources/views/admin/site-preferences.phtml (revision 36de22acf6348b1059dac63e3cd19589574906ac)
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    <?= csrf_field() ?>
21
22    <!-- INDEX_DIRECTORY -->
23    <div class="row form-group">
24        <label for="INDEX_DIRECTORY" class="col-sm-3 col-form-label">
25            <?= /* I18N: A configuration setting */
26            I18N::translate('Data folder') ?>
27        </label>
28        <div class="col-sm-9">
29            <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">
30            <p class="small text-muted">
31                <?= /* I18N: Help text for the "Data folder" site configuration setting */
32                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.') ?>
33            </p>
34            <p class="small text-muted">
35                <?= /* I18N: “Apache” is a software program. */
36                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.') ?>
37            </p>
38            <p class="small text-muted">
39                <?= 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.') ?>
40            </p>
41            <p class="small text-muted">
42                <?= 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/).') ?>
43            </p>
44        </div>
45    </div>
46
47    <!-- TIMEZONE -->
48    <div class="row form-group">
49        <label for="TIMEZONE" class="col-sm-3 col-form-label">
50            <?= I18N::translate('Time zone') ?>
51        </label>
52        <div class="col-sm-9">
53            <?= view('components/select', ['name' => 'TIMEZONE', 'selected' => Site::getPreference('TIMEZONE', 'UTC'), 'options' => array_combine(DateTimeZone::listIdentifiers(), DateTimeZone::listIdentifiers())]) ?>
54            <p class="small text-muted">
55                <?= I18N::translate('The time zone is required for date calculations, such as knowing today’s date.') ?>
56            </p>
57        </div>
58    </div>
59
60    <!-- THEME_DIR -->
61    <div class="row form-group">
62        <label for="THEME_DIR" class="col-sm-3 col-form-label">
63            <?= /* I18N: A configuration setting */
64            I18N::translate('Default theme') ?>
65        </label>
66        <div class="col-sm-9">
67            <?= view('components/select', ['name' => 'THEME_DIR', 'selected' => Site::getPreference('THEME_DIR', 'webtrees'), 'options' => $all_themes]) ?>
68            <p class="small text-muted">
69                <?= /* I18N: Help text for the "Default theme" site configuration setting */
70                I18N::translate('You can change the appearance of webtrees using “themes”. Each theme has a different style, layout, color scheme, etc.') ?>
71            </p>
72        </div>
73    </div>
74
75    <!-- LANGUAGE -->
76    <div class="row form-group">
77        <label class="col-sm-3 col-form-label" for="LANGUAGE">
78            <?= /* I18N: A configuration setting */ I18N::translate('Language') ?>
79        </label>
80        <div class="col-sm-9">
81            <select id="LANGUAGE" name="LANGUAGE" class="form-control">
82                <?php foreach (I18N::activeLocales() as $active_locale) : ?>
83                    <option value="<?= $active_locale->languageTag() ?>" <?= Site::getPreference('LANGUAGE') === $active_locale->languageTag() ? 'selected' : '' ?>>
84                        <?= $active_locale->endonym() ?>
85                    </option>
86                <?php endforeach ?>
87            </select>
88            <p class="small text-muted">
89                <?= /* 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.') ?>
90            </p>
91        </div>
92    </div>
93
94    <!-- ALLOW_CHANGE_GEDCOM -->
95    <fieldset class="form-group">
96        <div class="row">
97            <legend class="col-form-label col-sm-3">
98                <?= /* I18N: A configuration setting */
99                I18N::translate('Show list of family trees') ?>
100            </legend>
101            <div class="col-sm-9">
102                <?= view('components/radios-inline', ['name' => 'ALLOW_CHANGE_GEDCOM', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) Site::getPreference('ALLOW_CHANGE_GEDCOM')]) ?>
103                <p class="small text-muted">
104                    <?= /* I18N: Help text for the “Show list of family trees” site configuration setting */
105                    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.') ?>
106                </p>
107            </div>
108        </div>
109    </fieldset>
110
111    <div class="row form-group">
112        <div class="offset-sm-3 col-sm-9">
113            <button type="submit" class="btn btn-primary">
114                <?= view('icons/save') ?>
115                <?= I18N::translate('save') ?>
116            </button>
117
118            <a href="<?= e(route(ControlPanel::class)) ?>" class="btn btn-secondary">
119                <?= view('icons/cancel') ?>
120                <?= I18N::translate('cancel') ?>
121            </a>
122        </div>
123    </div>
124</form>
125