xref: /webtrees/resources/views/modules/faq/edit.phtml (revision 99c2ebaa768bfd7df48b9fc54e9134bbe9898e94)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
4use Fisharebest\Webtrees\Http\RequestHandlers\ModulesAllPage;
5use Fisharebest\Webtrees\I18N;
6
7/**
8 * @var int               $block_id
9 * @var int               $block_order
10 * @var string            $body
11 * @var int               $gedcom_id
12 * @var array<int,string> $gedcom_ids
13 * @var string            $header
14 * @var array<string>     $languages
15 * @var string            $title
16 *
17 */
18
19?>
20
21<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), route(ModulesAllPage::class) => I18N::translate('Modules'), route('module', ['module' => 'faq', 'action' => 'Admin']) => I18N::translate('Frequently asked questions'), $title]]) ?>
22
23<h1><?= $title ?></h1>
24
25<form method="post" name="faq" class="form-horizontal">
26    <input type="hidden" name="block_id" value="<?= $block_id ?>">
27
28    <div class="row mb-3">
29        <label for="header" class="col-sm-3 col-form-label">
30            <?= I18N::translate('Question') ?>
31        </label>
32
33        <div class="col-sm-9">
34            <input type="text" class="form-control" name="header" id="header"
35                value="<?= e($header) ?>">
36        </div>
37    </div>
38
39    <div class="row mb-3">
40        <label for="body" class="col-sm-3 col-form-label">
41            <?= I18N::translate('Answer') ?>
42        </label>
43
44        <div class="col-sm-9">
45            <textarea name="body" id="body" class="form-control html-edit" rows="10"><?= e($body) ?></textarea>
46        </div>
47    </div>
48
49    <div class="row mb-3">
50        <label for="xref" class="col-sm-3 col-form-label">
51            <?= /* I18N: Label for a configuration option */
52            I18N::translate('Show this block for which languages') ?>
53        </label>
54
55        <div class="col-sm-9">
56            <?= view('edit/language-checkboxes', ['languages' => $languages]) ?>
57        </div>
58    </div>
59
60    <div class="row mb-3">
61        <label for="block_order" class="col-sm-3 col-form-label">
62            <?= I18N::translate('Sort order') ?>
63        </label>
64
65        <div class="col-sm-9">
66            <input type="number" name="block_order" id="block_order" class="form-control" value="<?= $block_order ?>" min="1">
67        </div>
68    </div>
69
70    <div class="row mb-3">
71        <label for="gedcom_id" class="col-sm-3 col-form-label">
72            <?= I18N::translate('Family tree') ?>
73        </label>
74
75        <div class="col-sm-9">
76            <?= view('components/select', ['name' => 'gedcom_id', 'selected' => $gedcom_id, 'options' => $gedcom_ids]) ?>
77            <div class="form-text">
78                <?= /* I18N: FAQ = “Frequently Asked Question” */
79                I18N::translate('An FAQ can be displayed on just one of the family trees, or on all the family trees.') ?>
80            </div>
81        </div>
82    </div>
83
84    <div class="row mb-3">
85        <div class="offset-sm-3 col-sm-9">
86            <button type="submit" class="btn btn-primary">
87                <?= view('icons/save') ?>
88                <?= I18N::translate('save') ?>
89            </button>
90        </div>
91    </div>
92
93    <?= csrf_field() ?>
94</form>
95