xref: /webtrees/resources/views/modules/html/config.phtml (revision 090a06287954f43677f06ea778b3f67c029de8fe)
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        <p class="small text-muted">
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        </p>
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="form-group">
50    <div class="row">
51        <legend class="col-form-label col-sm-3">
52            <?= I18N::translate('Show the date and time of update') ?>
53        </legend>
54        <div class="col-sm-9">
55            <?= view('components/radios-inline', ['name' => 'show_timestamp', 'options' => [I18N::translate('no'), I18N::translate('yes')], 'selected' => (int) $show_timestamp]) ?>
56        </div>
57    </div>
58</fieldset>
59
60<fieldset class="form-group">
61    <div class="row">
62        <legend class="col-form-label col-sm-3">
63            <?= I18N::translate('Show this block for which languages') ?>
64        </legend>
65        <div class="col-sm-9">
66            <?= view('edit/language-checkboxes', ['languages' => $languages]) ?>
67        </div>
68    </div>
69</fieldset>
70
71<?php View::push('javascript') ?>
72<script>
73    $("#template").change(function () {
74        this.form.html.value=this.options[this.selectedIndex].value;
75        CKEDITOR.instances.html.setData(document.getElementById("html").value);
76    });
77</script>
78<?php View::endpush() ?>
79