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