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