xref: /webtrees/resources/views/admin/site-preferences.phtml (revision 81443e3cbe4eef5ccdcf8dae716a7e35f7417b60)
10c0910bfSGreg Roach<?php
2dd6b2bfcSGreg Roach
30c0910bfSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
4c7aa856bSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\SitePreferencesAction;
50c0910bfSGreg Roachuse Fisharebest\Webtrees\I18N;
60c0910bfSGreg Roachuse Fisharebest\Webtrees\Site;
70c0910bfSGreg Roach
8c7aa856bSGreg Roach/**
9c7aa856bSGreg Roach * @var array<string> $all_themes
10c7aa856bSGreg Roach * @var string        $title
11c7aa856bSGreg Roach */
12c7aa856bSGreg Roach
130c0910bfSGreg Roach?>
140c0910bfSGreg Roach
150c0910bfSGreg Roach<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), $title]]) ?>
16dd6b2bfcSGreg Roach
17dd6b2bfcSGreg Roach<h1><?= $title ?></h1>
18dd6b2bfcSGreg Roach
19c7aa856bSGreg Roach<form method="post" action="<?= e(route(SitePreferencesAction::class)) ?>" class="form-horizontal">
20dd6b2bfcSGreg Roach    <!-- INDEX_DIRECTORY -->
219e3c2cf9SGreg Roach    <div class="row mb-3">
22dd6b2bfcSGreg Roach        <label for="INDEX_DIRECTORY" class="col-sm-3 col-form-label">
23dd6b2bfcSGreg Roach            <?= /* I18N: A configuration setting */
24dd6b2bfcSGreg Roach            I18N::translate('Data folder') ?>
25dd6b2bfcSGreg Roach        </label>
26dd6b2bfcSGreg Roach        <div class="col-sm-9">
277dca5265SGreg Roach            <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">
28315eb316SGreg Roach            <div class="form-text">
29dd6b2bfcSGreg Roach                <?= /* I18N: Help text for the "Data folder" site configuration setting */
30dd6b2bfcSGreg Roach                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.') ?>
31315eb316SGreg Roach            </div>
32315eb316SGreg Roach            <div class="form-text">
33dd6b2bfcSGreg Roach                <?= /* I18N: “Apache” is a software program. */
34dd6b2bfcSGreg Roach                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.') ?>
35315eb316SGreg Roach            </div>
36315eb316SGreg Roach            <div class="form-text">
37dd6b2bfcSGreg Roach                <?= 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.') ?>
38315eb316SGreg Roach            </div>
39315eb316SGreg Roach            <div class="form-text">
40dd6b2bfcSGreg Roach                <?= 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/).') ?>
41315eb316SGreg Roach            </div>
42dd6b2bfcSGreg Roach        </div>
43dd6b2bfcSGreg Roach    </div>
44dd6b2bfcSGreg Roach
45dd6b2bfcSGreg Roach    <!-- TIMEZONE -->
469e3c2cf9SGreg Roach    <div class="row mb-3">
47dd6b2bfcSGreg Roach        <label for="TIMEZONE" class="col-sm-3 col-form-label">
48dd6b2bfcSGreg Roach            <?= I18N::translate('Time zone') ?>
49dd6b2bfcSGreg Roach        </label>
50dd6b2bfcSGreg Roach        <div class="col-sm-9">
518a07c98eSGreg Roach            <?= view('components/select', ['name' => 'TIMEZONE', 'selected' => Site::getPreference('TIMEZONE'), 'options' => array_combine(DateTimeZone::listIdentifiers(), DateTimeZone::listIdentifiers())]) ?>
52315eb316SGreg Roach            <div class="form-text">
53dd6b2bfcSGreg Roach                <?= I18N::translate('The time zone is required for date calculations, such as knowing today’s date.') ?>
54315eb316SGreg Roach            </div>
55dd6b2bfcSGreg Roach        </div>
56dd6b2bfcSGreg Roach    </div>
57dd6b2bfcSGreg Roach
58dd6b2bfcSGreg Roach    <!-- THEME_DIR -->
599e3c2cf9SGreg Roach    <div class="row mb-3">
60dd6b2bfcSGreg Roach        <label for="THEME_DIR" class="col-sm-3 col-form-label">
61dd6b2bfcSGreg Roach            <?= /* I18N: A configuration setting */
62dd6b2bfcSGreg Roach            I18N::translate('Default theme') ?>
63dd6b2bfcSGreg Roach        </label>
64dd6b2bfcSGreg Roach        <div class="col-sm-9">
658a07c98eSGreg Roach            <?= view('components/select', ['name' => 'THEME_DIR', 'selected' => Site::getPreference('THEME_DIR'), 'options' => $all_themes]) ?>
66315eb316SGreg Roach            <div class="form-text">
67dd6b2bfcSGreg Roach                <?= /* I18N: Help text for the "Default theme" site configuration setting */
68dd6b2bfcSGreg Roach                I18N::translate('You can change the appearance of webtrees using “themes”. Each theme has a different style, layout, color scheme, etc.') ?>
69315eb316SGreg Roach            </div>
70dd6b2bfcSGreg Roach        </div>
71dd6b2bfcSGreg Roach    </div>
72dd6b2bfcSGreg Roach
73c7aa856bSGreg Roach    <!-- LANGUAGE -->
749e3c2cf9SGreg Roach    <div class="row mb-3">
75c7aa856bSGreg Roach        <label class="col-sm-3 col-form-label" for="LANGUAGE">
76c7aa856bSGreg Roach            <?= /* I18N: A configuration setting */ I18N::translate('Language') ?>
77c7aa856bSGreg Roach        </label>
78c7aa856bSGreg Roach        <div class="col-sm-9">
794b9213b3SGreg Roach            <select id="LANGUAGE" name="LANGUAGE" class="form-select">
80c7aa856bSGreg Roach                <?php foreach (I18N::activeLocales() as $active_locale) : ?>
81c7aa856bSGreg Roach                    <option value="<?= $active_locale->languageTag() ?>" <?= Site::getPreference('LANGUAGE') === $active_locale->languageTag() ? 'selected' : '' ?>>
82c7aa856bSGreg Roach                        <?= $active_locale->endonym() ?>
83c7aa856bSGreg Roach                    </option>
84c7aa856bSGreg Roach                <?php endforeach ?>
85c7aa856bSGreg Roach            </select>
86315eb316SGreg Roach            <div class="form-text">
87c7aa856bSGreg Roach                <?= /* 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.') ?>
88315eb316SGreg Roach            </div>
89c7aa856bSGreg Roach        </div>
90c7aa856bSGreg Roach    </div>
91c7aa856bSGreg Roach
92dd6b2bfcSGreg Roach    <!-- ALLOW_CHANGE_GEDCOM -->
939e3c2cf9SGreg Roach    <fieldset class="row mb-3">
94dd6b2bfcSGreg Roach        <legend class="col-form-label col-sm-3">
95dd6b2bfcSGreg Roach            <?= /* I18N: A configuration setting */
96dd6b2bfcSGreg Roach            I18N::translate('Show list of family trees') ?>
97dd6b2bfcSGreg Roach        </legend>
98dd6b2bfcSGreg Roach        <div class="col-sm-9">
99c9e11c2aSGreg Roach            <?= view('components/radios-inline', ['name' => 'ALLOW_CHANGE_GEDCOM', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) Site::getPreference('ALLOW_CHANGE_GEDCOM')]) ?>
100315eb316SGreg Roach            <div class="form-text">
101dd6b2bfcSGreg Roach                <?= /* I18N: Help text for the “Show list of family trees” site configuration setting */
102dd6b2bfcSGreg Roach                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.') ?>
103dd6b2bfcSGreg Roach            </div>
104dd6b2bfcSGreg Roach        </div>
105dd6b2bfcSGreg Roach    </fieldset>
106dd6b2bfcSGreg Roach
1079e3c2cf9SGreg Roach    <div class="row mb-3">
108dd6b2bfcSGreg Roach        <div class="offset-sm-3 col-sm-9">
109dd6b2bfcSGreg Roach            <button type="submit" class="btn btn-primary">
110dd6b2bfcSGreg Roach                <?= view('icons/save') ?>
111dd6b2bfcSGreg Roach                <?= I18N::translate('save') ?>
112dd6b2bfcSGreg Roach            </button>
113dd6b2bfcSGreg Roach
1140c0910bfSGreg Roach            <a href="<?= e(route(ControlPanel::class)) ?>" class="btn btn-secondary">
115dd6b2bfcSGreg Roach                <?= view('icons/cancel') ?>
116dd6b2bfcSGreg Roach                <?= I18N::translate('cancel') ?>
117dd6b2bfcSGreg Roach            </a>
118dd6b2bfcSGreg Roach        </div>
119dd6b2bfcSGreg Roach    </div>
120*81443e3cSGreg Roach
121*81443e3cSGreg Roach    <?= csrf_field() ?>
122dd6b2bfcSGreg Roach</form>
123