xref: /webtrees/resources/views/modules/html/config.phtml (revision ac71572d8462e396ed5a307f05b29381e49f9e6e)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\I18N;
6use Fisharebest\Webtrees\View;
7
8/**
9 * @var string               $html
10 * @var array<int,string>    $languages
11 * @var bool                 $show_timestamp
12 * @var array<string,string> $templates
13 * @var string               $title
14 */
15
16?>
17
18<div class="row mb-3">
19    <label class="col-sm-3 col-form-label" for="title">
20        <?= I18N::translate('Title') ?>
21    </label>
22    <div class="col-sm-9">
23        <input class="form-control" type="text" id="title" name="title" value="<?= e($title) ?>">
24    </div>
25</div>
26
27<div class="row mb-3">
28    <label class="col-sm-3 col-form-label" for="template">
29        <?= I18N::translate('Templates') ?>
30    </label>
31    <div class="col-sm-9">
32        <?= view('components/select', ['name' => '', 'id' => 'template', 'selected' => '', 'options' => $templates]) ?>
33        <div class="form-text">
34            <?= I18N::translate('To assist you in getting started with this block, we have created several standard templates. When you select one of these templates, the text area will contain a copy that you can then alter to suit your site’s requirements.') ?>
35        </div>
36    </div>
37</div>
38
39<div class="row mb-3">
40    <label class="col-sm-3 col-form-label" for="html">
41        <?= I18N::translate('Content') ?>
42    </label>
43    <div class="col-sm-9">
44        <p>
45            <?= I18N::translate('As well as using the toolbar to apply HTML formatting, you can insert database fields which are updated automatically. These special fields are marked with <b>#</b> characters. For example <b>#totalFamilies#</b> will be replaced with the actual number of families in the database. Advanced users may wish to apply CSS classes to their text, so that the formatting matches the currently selected theme.') ?>
46        </p>
47        <textarea name="html" id="html" class="html-edit form-control" rows="10"><?= e($html) ?></textarea>
48    </div>
49</div>
50
51<fieldset class="row mb-3">
52    <legend class="col-form-label col-sm-3">
53        <?= I18N::translate('Show the date and time of update') ?>
54    </legend>
55    <div class="col-sm-9">
56        <?= view('components/radios-inline', ['name' => 'show_timestamp', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $show_timestamp]) ?>
57    </div>
58</fieldset>
59
60<fieldset class="row mb-3">
61    <legend class="col-form-label col-sm-3">
62        <?= I18N::translate('Show this block for which languages') ?>
63    </legend>
64    <div class="col-sm-9">
65        <?= view('edit/language-checkboxes', ['languages' => $languages]) ?>
66    </div>
67</fieldset>
68
69<?php View::push('javascript') ?>
70<script>
71    $("#template").change(function () {
72        this.form.html.value=this.options[this.selectedIndex].value;
73        CKEDITOR.instances.html.setData(document.getElementById("html").value);
74    });
75</script>
76<?php View::endpush() ?>
77