xref: /webtrees/resources/views/modules/faq/edit.phtml (revision 9deadf1c5b187f630fcc0ae0771860f690e7f202)
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    <?= csrf_field() ?>
27    <input type="hidden" name="block_id" value="<?= $block_id ?>">
28
29    <div class="row form-group">
30        <label for="header" class="col-sm-3 col-form-label">
31            <?= I18N::translate('Question') ?>
32        </label>
33
34        <div class="col-sm-9">
35            <input type="text" class="form-control" name="header" id="header"
36                value="<?= e($header) ?>">
37        </div>
38    </div>
39
40    <div class="row form-group">
41        <label for="body" class="col-sm-3 col-form-label">
42            <?= I18N::translate('Answer') ?>
43        </label>
44
45        <div class="col-sm-9">
46            <textarea name="body" id="body" class="form-control html-edit" rows="10"><?= e($body) ?></textarea>
47        </div>
48    </div>
49
50    <div class="row form-group">
51        <label for="xref" class="col-sm-3 col-form-label">
52            <?= /* I18N: Label for a configuration option */
53            I18N::translate('Show this block for which languages') ?>
54        </label>
55
56        <div class="col-sm-9">
57            <?= view('edit/language-checkboxes', ['languages' => $languages]) ?>
58        </div>
59    </div>
60
61    <div class="row form-group">
62        <label for="block_order" class="col-sm-3 col-form-label">
63            <?= I18N::translate('Sort order') ?>
64        </label>
65
66        <div class="col-sm-9">
67            <input type="number" name="block_order" id="block_order" class="form-control" value="<?= $block_order ?>" min="1">
68        </div>
69    </div>
70
71    <div class="row form-group">
72        <label for="gedcom_id" class="col-sm-3 col-form-label">
73            <?= I18N::translate('Family tree') ?>
74        </label>
75
76        <div class="col-sm-9">
77            <?= view('components/select', ['name' => 'gedcom_id', 'selected' => $gedcom_id, 'options' => $gedcom_ids]) ?>
78            <p class="small text-muted">
79                <?= /* I18N: FAQ = “Frequently Asked Question” */
80                I18N::translate('An FAQ can be displayed on just one of the family trees, or on all the family trees.') ?>
81            </p>
82        </div>
83    </div>
84
85    <div class="row form-group">
86        <div class="offset-sm-3 col-sm-9">
87            <button type="submit" class="btn btn-primary">
88                <?= view('icons/save') ?>
89                <?= I18N::translate('save') ?>
90            </button>
91        </div>
92    </div>
93</form>
94