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