xref: /webtrees/resources/views/admin/site-registration.phtml (revision 5bfc689774bb9a6401271c4ed15a6d50652c991b)
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    <?= csrf_field() ?>
22
23    <!-- WELCOME_TEXT_AUTH_MODE -->
24    <div class="row form-group mb-3">
25        <label for="WELCOME_TEXT_AUTH_MODE" class="col-sm-3 col-form-label">
26            <?= /* I18N: A configuration setting */ I18N::translate('Welcome text on sign-in page') ?>
27        </label>
28        <div class="col-sm-9">
29            <?= view('components/select', ['name' => 'WELCOME_TEXT_AUTH_MODE', 'selected' => Site::getPreference('WELCOME_TEXT_AUTH_MODE'), 'options' => $registration_text_options]) ?>
30            <div class="form-text">
31            </div>
32        </div>
33    </div>
34
35    <!-- WELCOME_TEXT_AUTH_MODE_4 -->
36    <div class="row form-group mb-3">
37        <label for="WELCOME_TEXT_AUTH_MODE_4" class="col-sm-3 col-form-label">
38            <?= /* I18N: A configuration setting */ I18N::translate('Custom welcome text') ?>
39        </label>
40        <div class="col-sm-9">
41            <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>
42            <div class="form-text">
43                <?= /* 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.') ?>
44            </div>
45        </div>
46    </div>
47
48    <!-- USE_REGISTRATION_MODULE -->
49    <fieldset class="row form-group mb-3">
50        <legend class="col-form-label col-sm-3">
51            <?= /* I18N: A configuration setting */ I18N::translate('Allow visitors to request a new user account') ?>
52        </legend>
53        <div class="col-sm-9">
54            <?= view('components/radios-inline', ['name' => 'USE_REGISTRATION_MODULE', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) Site::getPreference('USE_REGISTRATION_MODULE')]) ?>
55            <div class="form-text">
56                <?= I18N::translate('The new user will be asked to confirm their email address before the account is created.') ?>
57                <?= I18N::translate('Details of the new user will be sent to the genealogy contact for the corresponding family tree.') ?>
58                <?= I18N::translate('An administrator must approve the new user account and select an access level before the user can sign in.') ?>
59            </div>
60        </div>
61    </fieldset>
62
63    <!-- SHOW_REGISTER_CAUTION -->
64    <fieldset class="row form-group mb-3">
65        <legend class="col-form-label col-sm-3">
66            <?= /* I18N: A configuration setting */ I18N::translate('Show acceptable use agreement on “Request a new user account” page') ?>
67        </legend>
68        <div class="col-sm-9">
69            <?= view('components/radios-inline', ['name' => 'SHOW_REGISTER_CAUTION', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) Site::getPreference('SHOW_REGISTER_CAUTION')]) ?>
70            <div class="form-text">
71            </div>
72        </div>
73    </fieldset>
74
75    <div class="row form-group mb-3">
76        <div class="offset-sm-3 col-sm-9">
77            <button type="submit" class="btn btn-primary">
78                <?= view('icons/save') ?>
79                <?= I18N::translate('save') ?>
80            </button>
81
82            <a href="<?= e(route(ControlPanel::class)) ?>" class="btn btn-secondary">
83                <?= view('icons/cancel') ?>
84                <?= I18N::translate('cancel') ?>
85            </a>
86        </div>
87    </div>
88</form>
89