xref: /webtrees/resources/views/report-setup-page.phtml (revision 753e86301bbfbbdd508c82990ef27571eca12b18)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\I18N;
6
7/**
8 * @var string               $title
9 * @var string               $description
10 * @var string               $destination
11 * @var string               $format
12 * @var array<array<string>> $inputs
13 */
14
15?>
16
17<h2 class="wt-page-title">
18    <?= $title ?>
19</h2>
20
21<form method="post" class="wt-page-options wt-page-options-report-setup">
22    <div class="row">
23        <div class="col-sm-3 col-form-label wt-page-options-label">
24            <?= I18N::translate('Description') ?>
25        </div>
26        <div class="col-sm-9 wt-page-options-value">
27            <?= $description ?>
28        </div>
29    </div>
30
31    <?php foreach ($inputs as $n => $input) : ?>
32        <input type="hidden" name="varnames[]" value="<?= e($input['name']) ?>">
33        <div class="row">
34            <label class="col-sm-3 col-form-label wt-page-options-label" for="input-<?= $n ?>">
35                <?= I18N::translate($input['value']) ?>
36            </label>
37            <div class="col-sm-9 wt-page-options-value">
38                <?php if ($input['extra'] !== '') : ?>
39                    <div class="input-group">
40                        <?= $input['control'] ?>
41                        <?= $input['extra'] ?>
42                    </div>
43                    <div id="caldivinput-<?= e($n) ?>" style="position:absolute;visibility:hidden;background-color:white;z-index:1000"></div>
44                <?php else : ?>
45                    <?= $input['control'] ?>
46                <?php endif ?>
47            </div>
48        </div>
49    <?php endforeach ?>
50
51    <div class="row">
52        <div class="col-sm-3 col-form-label wt-page-options-label">
53            <?= I18N::translate('Format') ?>
54        </div>
55
56        <div class="col-sm-9 wt-page-options-value d-flex justify-content-around">
57            <div class="text-center">
58                <label for="HTML" title="HTML">
59                    <?= view('icons/mime', ['type' => 'text/html']) ?>
60                    <span class="visually-hidden">HTML</span>
61                </label>
62                <br>
63                <input type="radio" name="format" id="HTML" value="HTML" <?= $format === 'HTML' ? 'checked' : '' ?>>
64            </div>
65            <div class="text-center">
66                <label for="PDF" title="PDF">
67                    <?= view('icons/mime', ['type' => 'application/pdf']) ?>
68                    <span class="visually-hidden">PDF</span>
69                </label>
70                <br>
71                <input type="radio" name="format" value="PDF" id="PDF" <?= $format === 'PDF' ? 'checked' : '' ?>>
72            </div>
73        </div>
74    </div>
75
76    <div class="row">
77        <div class="col-sm-3 col-form-label wt-page-options-label"></div>
78        <div class="col-sm-9 wt-page-options-value">
79            <?php if ($destination === 'download') : ?>
80                <button type="submit" name="destination" value="download" class="btn btn-primary">
81                    <?= view('icons/download') ?>
82                    <?= I18N::translate('download') ?>
83                </button>
84                <button type="submit" name="destination" value="view" class="btn btn-secondary">
85                    <?= view('icons/report') ?>
86                    <?= I18N::translate('view') ?>
87                </button>
88            <?php else : ?>
89                <button type="submit" name="destination" value="view" class="btn btn-primary">
90                    <?= view('icons/report') ?>
91                    <?= I18N::translate('view') ?>
92                </button>
93                <button type="submit" name="destination" value="download" class="btn btn-secondary">
94                    <?= view('icons/download') ?>
95                    <?= I18N::translate('download') ?>
96                </button>
97            <?php endif ?>
98        </div>
99    </div>
100
101    <?= csrf_field() ?>
102</form>
103