xref: /webtrees/resources/views/admin/site-preferences.phtml (revision 3f17da1ad8d9a8ffdf20212b66fa8455d49562ac)
10c0910bfSGreg Roach<?php
2dd6b2bfcSGreg Roach
310e06497SGreg Roachdeclare(strict_types=1);
410e06497SGreg Roach
50c0910bfSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
6c7aa856bSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\SitePreferencesAction;
70c0910bfSGreg Roachuse Fisharebest\Webtrees\I18N;
80c0910bfSGreg Roachuse Fisharebest\Webtrees\Site;
90c0910bfSGreg Roach
10c7aa856bSGreg Roach/**
11c7aa856bSGreg Roach * @var array<string> $all_themes
12*3f17da1aSGreg Roach * @var string        $data_folder
13c7aa856bSGreg Roach * @var string        $title
14c7aa856bSGreg Roach */
15c7aa856bSGreg Roach
160c0910bfSGreg Roach?>
170c0910bfSGreg Roach
180c0910bfSGreg Roach<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), $title]]) ?>
19dd6b2bfcSGreg Roach
20dd6b2bfcSGreg Roach<h1><?= $title ?></h1>
21dd6b2bfcSGreg Roach
22c7aa856bSGreg Roach<form method="post" action="<?= e(route(SitePreferencesAction::class)) ?>" class="form-horizontal">
23dd6b2bfcSGreg Roach    <!-- INDEX_DIRECTORY -->
249e3c2cf9SGreg Roach    <div class="row mb-3">
25dd6b2bfcSGreg Roach        <label for="INDEX_DIRECTORY" class="col-sm-3 col-form-label">
26dd6b2bfcSGreg Roach            <?= /* I18N: A configuration setting */
27dd6b2bfcSGreg Roach            I18N::translate('Data folder') ?>
28dd6b2bfcSGreg Roach        </label>
29dd6b2bfcSGreg Roach        <div class="col-sm-9">
30*3f17da1aSGreg Roach            <input type="text" class="form-control" dir="ltr" id="INDEX_DIRECTORY" name="INDEX_DIRECTORY" value="<?= e($data_folder) ?>" maxlength="255" placeholder="data/" required="required">
31315eb316SGreg Roach            <div class="form-text">
32dd6b2bfcSGreg Roach                <?= /* I18N: Help text for the "Data folder" site configuration setting */
33dd6b2bfcSGreg 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.') ?>
34315eb316SGreg Roach            </div>
35315eb316SGreg Roach            <div class="form-text">
36dd6b2bfcSGreg Roach                <?= /* I18N: “Apache” is a software program. */
37dd6b2bfcSGreg 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.') ?>
38315eb316SGreg Roach            </div>
39315eb316SGreg Roach            <div class="form-text">
40dd6b2bfcSGreg 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.') ?>
41315eb316SGreg Roach            </div>
42315eb316SGreg Roach            <div class="form-text">
43dd6b2bfcSGreg 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/).') ?>
44315eb316SGreg Roach            </div>
45dd6b2bfcSGreg Roach        </div>
46dd6b2bfcSGreg Roach    </div>
47dd6b2bfcSGreg Roach
48dd6b2bfcSGreg Roach    <!-- TIMEZONE -->
499e3c2cf9SGreg Roach    <div class="row mb-3">
50dd6b2bfcSGreg Roach        <label for="TIMEZONE" class="col-sm-3 col-form-label">
51dd6b2bfcSGreg Roach            <?= I18N::translate('Time zone') ?>
52dd6b2bfcSGreg Roach        </label>
53dd6b2bfcSGreg Roach        <div class="col-sm-9">
548a07c98eSGreg Roach            <?= view('components/select', ['name' => 'TIMEZONE', 'selected' => Site::getPreference('TIMEZONE'), 'options' => array_combine(DateTimeZone::listIdentifiers(), DateTimeZone::listIdentifiers())]) ?>
55315eb316SGreg Roach            <div class="form-text">
56dd6b2bfcSGreg Roach                <?= I18N::translate('The time zone is required for date calculations, such as knowing today’s date.') ?>
57315eb316SGreg Roach            </div>
58dd6b2bfcSGreg Roach        </div>
59dd6b2bfcSGreg Roach    </div>
60dd6b2bfcSGreg Roach
61dd6b2bfcSGreg Roach    <!-- THEME_DIR -->
629e3c2cf9SGreg Roach    <div class="row mb-3">
63dd6b2bfcSGreg Roach        <label for="THEME_DIR" class="col-sm-3 col-form-label">
64dd6b2bfcSGreg Roach            <?= /* I18N: A configuration setting */
65dd6b2bfcSGreg Roach            I18N::translate('Default theme') ?>
66dd6b2bfcSGreg Roach        </label>
67dd6b2bfcSGreg Roach        <div class="col-sm-9">
688a07c98eSGreg Roach            <?= view('components/select', ['name' => 'THEME_DIR', 'selected' => Site::getPreference('THEME_DIR'), 'options' => $all_themes]) ?>
69315eb316SGreg Roach            <div class="form-text">
70dd6b2bfcSGreg Roach                <?= /* I18N: Help text for the "Default theme" site configuration setting */
71dd6b2bfcSGreg Roach                I18N::translate('You can change the appearance of webtrees using “themes”. Each theme has a different style, layout, color scheme, etc.') ?>
72315eb316SGreg Roach            </div>
73dd6b2bfcSGreg Roach        </div>
74dd6b2bfcSGreg Roach    </div>
75dd6b2bfcSGreg Roach
76c7aa856bSGreg Roach    <!-- LANGUAGE -->
779e3c2cf9SGreg Roach    <div class="row mb-3">
78c7aa856bSGreg Roach        <label class="col-sm-3 col-form-label" for="LANGUAGE">
79c7aa856bSGreg Roach            <?= /* I18N: A configuration setting */ I18N::translate('Language') ?>
80c7aa856bSGreg Roach        </label>
81c7aa856bSGreg Roach        <div class="col-sm-9">
824b9213b3SGreg Roach            <select id="LANGUAGE" name="LANGUAGE" class="form-select">
83c7aa856bSGreg Roach                <?php foreach (I18N::activeLocales() as $active_locale) : ?>
84c7aa856bSGreg Roach                    <option value="<?= $active_locale->languageTag() ?>" <?= Site::getPreference('LANGUAGE') === $active_locale->languageTag() ? 'selected' : '' ?>>
85c7aa856bSGreg Roach                        <?= $active_locale->endonym() ?>
86c7aa856bSGreg Roach                    </option>
87c7aa856bSGreg Roach                <?php endforeach ?>
88c7aa856bSGreg Roach            </select>
89315eb316SGreg Roach            <div class="form-text">
90c7aa856bSGreg 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.') ?>
91315eb316SGreg Roach            </div>
92c7aa856bSGreg Roach        </div>
93c7aa856bSGreg Roach    </div>
94c7aa856bSGreg Roach
95dd6b2bfcSGreg Roach    <!-- ALLOW_CHANGE_GEDCOM -->
969e3c2cf9SGreg Roach    <fieldset class="row mb-3">
97dd6b2bfcSGreg Roach        <legend class="col-form-label col-sm-3">
98dd6b2bfcSGreg Roach            <?= /* I18N: A configuration setting */
99dd6b2bfcSGreg Roach            I18N::translate('Show list of family trees') ?>
100dd6b2bfcSGreg Roach        </legend>
101dd6b2bfcSGreg Roach        <div class="col-sm-9">
102c9e11c2aSGreg Roach            <?= view('components/radios-inline', ['name' => 'ALLOW_CHANGE_GEDCOM', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) Site::getPreference('ALLOW_CHANGE_GEDCOM')]) ?>
103315eb316SGreg Roach            <div class="form-text">
104dd6b2bfcSGreg Roach                <?= /* I18N: Help text for the “Show list of family trees” site configuration setting */
105dd6b2bfcSGreg 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.') ?>
106dd6b2bfcSGreg Roach            </div>
107dd6b2bfcSGreg Roach        </div>
108dd6b2bfcSGreg Roach    </fieldset>
109dd6b2bfcSGreg Roach
1109e3c2cf9SGreg Roach    <div class="row mb-3">
111dd6b2bfcSGreg Roach        <div class="offset-sm-3 col-sm-9">
112dd6b2bfcSGreg Roach            <button type="submit" class="btn btn-primary">
113dd6b2bfcSGreg Roach                <?= view('icons/save') ?>
114dd6b2bfcSGreg Roach                <?= I18N::translate('save') ?>
115dd6b2bfcSGreg Roach            </button>
116dd6b2bfcSGreg Roach
1170c0910bfSGreg Roach            <a href="<?= e(route(ControlPanel::class)) ?>" class="btn btn-secondary">
118dd6b2bfcSGreg Roach                <?= view('icons/cancel') ?>
119dd6b2bfcSGreg Roach                <?= I18N::translate('cancel') ?>
120dd6b2bfcSGreg Roach            </a>
121dd6b2bfcSGreg Roach        </div>
122dd6b2bfcSGreg Roach    </div>
12381443e3cSGreg Roach
12481443e3cSGreg Roach    <?= csrf_field() ?>
125dd6b2bfcSGreg Roach</form>
126