xref: /webtrees/resources/views/modules/html/config.phtml (revision 2ebcf907ed34213f816592af04e6c160335d6311)
1<?php
2
3use Fisharebest\Webtrees\I18N;
4use Fisharebest\Webtrees\View;
5
6/**
7 * @var string               $html
8 * @var array<int,string>    $languages
9 * @var bool                 $show_timestamp
10 * @var array<string,string> $templates
11 * @var string               $title
12 */
13
14?>
15
16<div class="row form-group">
17    <label class="col-sm-3 col-form-label" for="title">
18        <?= I18N::translate('Title') ?>
19    </label>
20    <div class="col-sm-9">
21        <input class="form-control" type="text" id="title" name="title" value="<?= e($title) ?>">
22    </div>
23</div>
24
25<div class="row form-group">
26    <label class="col-sm-3 col-form-label" for="template">
27        <?= I18N::translate('Templates') ?>
28    </label>
29    <div class="col-sm-9">
30        <?= view('components/select', ['name' => '', 'id' => 'template', 'selected' => '', 'options' => $templates]) ?>
31        <div class="form-text">
32            <?= 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.') ?>
33        </div>
34    </div>
35</div>
36
37<div class="row form-group">
38    <label class="col-sm-3 col-form-label" for="html">
39        <?= I18N::translate('Content') ?>
40    </label>
41    <div class="col-sm-9">
42        <p>
43            <?= 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.') ?>
44        </p>
45        <textarea name="html" id="html" class="html-edit form-control" rows="10"><?= e($html) ?></textarea>
46    </div>
47</div>
48
49<fieldset class="row form-group">
50    <legend class="col-form-label col-sm-3">
51        <?= I18N::translate('Show the date and time of update') ?>
52    </legend>
53    <div class="col-sm-9">
54        <?= view('components/radios-inline', ['name' => 'show_timestamp', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $show_timestamp]) ?>
55    </div>
56</fieldset>
57
58<fieldset class="row form-group">
59    <legend class="col-form-label col-sm-3">
60        <?= I18N::translate('Show this block for which languages') ?>
61    </legend>
62    <div class="col-sm-9">
63        <?= view('edit/language-checkboxes', ['languages' => $languages]) ?>
64    </div>
65</fieldset>
66
67<?php View::push('javascript') ?>
68<script>
69    $("#template").change(function () {
70        this.form.html.value=this.options[this.selectedIndex].value;
71        CKEDITOR.instances.html.setData(document.getElementById("html").value);
72    });
73</script>
74<?php View::endpush() ?>
75