xref: /webtrees/resources/views/admin/site-preferences.phtml (revision 6fd4f6e3d5a2c64c159e88e10883a1ccab4d4a42)
1<?php use Fisharebest\Webtrees\Bootstrap4; ?>
2<?php use Fisharebest\Webtrees\Functions\FunctionsEdit; ?>
3<?php use Fisharebest\Webtrees\I18N; ?>
4<?php use Fisharebest\Webtrees\Site; ?>
5
6<?= view('components/breadcrumbs', ['links' => [route('admin-control-panel') => I18N::translate('Control panel'), $title]]) ?>
7
8<h1><?= $title ?></h1>
9
10<form method="post" class="form-horizontal">
11    <?= csrf_field() ?>
12
13    <!-- INDEX_DIRECTORY -->
14    <div class="row form-group">
15        <label for="INDEX_DIRECTORY" class="col-sm-3 col-form-label">
16            <?= /* I18N: A configuration setting */
17            I18N::translate('Data folder') ?>
18        </label>
19        <div class="col-sm-9">
20            <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>
21            <p class="small text-muted">
22                <?= /* I18N: Help text for the "Data folder" site configuration setting */
23                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.') ?>
24            </p>
25            <p class="small text-muted">
26                <?= /* I18N: “Apache” is a software program. */
27                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.') ?>
28            </p>
29            <p class="small text-muted">
30                <?= 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.') ?>
31            </p>
32            <p class="small text-muted">
33                <?= 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/).') ?>
34            </p>
35        </div>
36    </div>
37
38    <!-- MEMORY_LIMIT -->
39    <div class="row form-group">
40        <label for="MEMORY_LIMIT" class="col-sm-3 col-form-label">
41            <?= /* I18N: A configuration setting */
42            I18N::translate('Memory limit') ?>
43        </label>
44        <div class="col-sm-9">
45            <input type="text" class="form-control" id="MEMORY_LIMIT" name="MEMORY_LIMIT" value="<?= e(Site::getPreference('MEMORY_LIMIT')) ?>" pattern="[0-9]+[KMG]" placeholder="<?= get_cfg_var('memory_limit') ?>" maxlength="255">
46            <p class="small text-muted">
47                <?= /* I18N: %s is an amount of memory, such as 32MB */
48                I18N::translate('By default, your server allows scripts to use %s of memory.', get_cfg_var('memory_limit')) ?>
49                <?= I18N::translate('You can request a higher or lower limit, although the server may ignore this request.') ?>
50                <?= I18N::translate('Leave this blank to use the default value.') ?>
51            </p>
52        </div>
53    </div>
54
55    <!-- MAX_EXECUTION_TIME -->
56    <div class="row form-group">
57        <label for="MAX_EXECUTION_TIME" class="col-sm-3 col-form-label">
58            <?= /* I18N: A configuration setting */
59            I18N::translate('PHP time limit') ?>
60        </label>
61        <div class="col-sm-9">
62            <input type="text" class="form-control" id="MAX_EXECUTION_TIME" name="MAX_EXECUTION_TIME" value="<?= e(Site::getPreference('MAX_EXECUTION_TIME')) ?>" pattern="[0-9]*" placeholder="<?= get_cfg_var('max_execution_time') ?>" maxlength="255">
63            <p class="small text-muted">
64                <?= I18N::plural('By default, your server allows scripts to run for %s second.', 'By default, your server allows scripts to run for %s seconds.', $max_execution_time, I18N::number($max_execution_time)); ?>
65                <?= I18N::translate('You can request a higher or lower limit, although the server may ignore this request.') ?>
66                <?= I18N::translate('Leave this blank to use the default value.') ?>
67            </p>
68        </div>
69    </div>
70
71    <!-- TIMEZONE -->
72    <div class="row form-group">
73        <label for="TIMEZONE" class="col-sm-3 col-form-label">
74            <?= I18N::translate('Time zone') ?>
75        </label>
76        <div class="col-sm-9">
77            <?= Bootstrap4::select(array_combine(\DateTimeZone::listIdentifiers(), \DateTimeZone::listIdentifiers()), Site::getPreference('TIMEZONE') ?: 'UTC', ['id' => 'TIMEZONE', 'name' => 'TIMEZONE']) ?>
78            <p class="small text-muted">
79                <?= I18N::translate('The time zone is required for date calculations, such as knowing today’s date.') ?>
80            </p>
81        </div>
82    </div>
83
84    <!-- THEME_DIR -->
85    <div class="row form-group">
86        <label for="THEME_DIR" class="col-sm-3 col-form-label">
87            <?= /* I18N: A configuration setting */
88            I18N::translate('Default theme') ?>
89        </label>
90        <div class="col-sm-9">
91            <?= Bootstrap4::select($all_themes, Site::getPreference('THEME_DIR', 'webtrees'), ['id' => 'THEME_DIR', 'name' => 'THEME_DIR']) ?>
92            <p class="small text-muted">
93                <?= /* I18N: Help text for the "Default theme" site configuration setting */
94                I18N::translate('You can change the appearance of webtrees using “themes”. Each theme has a different style, layout, color scheme, etc.') ?>
95            </p>
96            <p class="small text-muted">
97                <?= I18N::translate('Themes can be selected at three levels: user, family tree, and website. User preferences take priority over family tree preferences, which in turn take priority over the website preferences. Selecting “default theme” at one level will use the theme at the next level.') ?>
98            </p>
99        </div>
100    </div>
101
102    <!-- ALLOW_CHANGE_GEDCOM -->
103    <fieldset class="form-group">
104        <div class="row">
105            <legend class="col-form-label col-sm-3">
106                <?= /* I18N: A configuration setting */
107                I18N::translate('Show list of family trees') ?>
108            </legend>
109            <div class="col-sm-9">
110                <?= Bootstrap4::radioButtons('ALLOW_CHANGE_GEDCOM', FunctionsEdit::optionsNoYes(), (string) (int) Site::getPreference('ALLOW_CHANGE_GEDCOM'), true) ?>
111                <p class="small text-muted">
112                    <?= /* I18N: Help text for the “Show list of family trees” site configuration setting */
113                    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.') ?>
114                </p>
115            </div>
116        </div>
117    </fieldset>
118
119    <div class="row form-group">
120        <div class="offset-sm-3 col-sm-9">
121            <button type="submit" class="btn btn-primary">
122                <?= view('icons/save') ?>
123                <?= I18N::translate('save') ?>
124            </button>
125
126            <a href="<?= e(route('admin-control-panel')) ?>" class="btn btn-secondary">
127                <?= view('icons/cancel') ?>
128                <?= I18N::translate('cancel') ?>
129            </a>
130        </div>
131    </div>
132</form>
133