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