xref: /webtrees/resources/views/admin/site-registration.phtml (revision a412b4b4262c063543c68c4b2ede3586f33d64f0)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
4use Fisharebest\Webtrees\Http\RequestHandlers\SiteRegistrationAction;
5use Fisharebest\Webtrees\I18N;
6use Fisharebest\Webtrees\Site;
7
8/**
9 * @var string        $language_tag
10 * @var array<string> $registration_text_options
11 * @var string        $title
12 */
13
14?>
15
16<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), $title]]) ?>
17
18<h1><?= $title ?></h1>
19
20<form method="post" action="<?= e(route(SiteRegistrationAction::class)) ?>" class="form-horizontal">
21    <!-- WELCOME_TEXT_AUTH_MODE -->
22    <div class="row mb-3">
23        <label for="WELCOME_TEXT_AUTH_MODE" class="col-sm-3 col-form-label">
24            <?= /* I18N: A configuration setting */ I18N::translate('Welcome text on sign-in page') ?>
25        </label>
26        <div class="col-sm-9">
27            <?= view('components/select', ['name' => 'WELCOME_TEXT_AUTH_MODE', 'selected' => Site::getPreference('WELCOME_TEXT_AUTH_MODE'), 'options' => $registration_text_options]) ?>
28            <div class="form-text">
29            </div>
30        </div>
31    </div>
32
33    <!-- WELCOME_TEXT_AUTH_MODE_4 -->
34    <div class="row mb-3">
35        <label for="WELCOME_TEXT_AUTH_MODE_4" class="col-sm-3 col-form-label">
36            <?= /* I18N: A configuration setting */ I18N::translate('Custom welcome text') ?>
37        </label>
38        <div class="col-sm-9">
39            <textarea class="form-control" id="WELCOME_TEXT_AUTH_MODE_4" name="WELCOME_TEXT_AUTH_MODE_4" rows="5" dir="auto" maxlength="2000"><?= e(Site::getPreference('WELCOME_TEXT_AUTH_MODE_' . $language_tag)) ?></textarea>
40            <div class="form-text">
41                <?= /* I18N: Help text for the "Custom welcome text" site configuration setting */ I18N::translate('To set this text for other languages, you must switch to that language, and visit this page again.') ?>
42            </div>
43        </div>
44    </div>
45
46    <!-- USE_REGISTRATION_MODULE -->
47    <fieldset class="row mb-3">
48        <legend class="col-form-label col-sm-3">
49            <?= /* I18N: A configuration setting */ I18N::translate('Allow visitors to request a new user account') ?>
50        </legend>
51        <div class="col-sm-9">
52            <?= view('components/radios-inline', ['name' => 'USE_REGISTRATION_MODULE', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) Site::getPreference('USE_REGISTRATION_MODULE')]) ?>
53            <div class="form-text">
54                <?= I18N::translate('The new user will be asked to confirm their email address before the account is created.') ?>
55                <?= I18N::translate('Details of the new user will be sent to the genealogy contact for the corresponding family tree.') ?>
56                <?= I18N::translate('An administrator must approve the new user account and select an access level before the user can sign in.') ?>
57            </div>
58        </div>
59    </fieldset>
60
61    <!-- SHOW_REGISTER_CAUTION -->
62    <fieldset class="row mb-3">
63        <legend class="col-form-label col-sm-3">
64            <?= /* I18N: A configuration setting */ I18N::translate('Show acceptable use agreement on “Request a new user account” page') ?>
65        </legend>
66        <div class="col-sm-9">
67            <?= view('components/radios-inline', ['name' => 'SHOW_REGISTER_CAUTION', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) Site::getPreference('SHOW_REGISTER_CAUTION')]) ?>
68            <div class="form-text">
69            </div>
70        </div>
71    </fieldset>
72
73    <div class="row mb-3">
74        <div class="offset-sm-3 col-sm-9">
75            <button type="submit" class="btn btn-primary">
76                <?= view('icons/save') ?>
77                <?= I18N::translate('save') ?>
78            </button>
79
80            <a href="<?= e(route(ControlPanel::class)) ?>" class="btn btn-secondary">
81                <?= view('icons/cancel') ?>
82                <?= I18N::translate('cancel') ?>
83            </a>
84        </div>
85    </div>
86
87    <?= csrf_field() ?>
88</form>
89