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