xref: /webtrees/resources/views/modules/relationships-chart/config.phtml (revision dda05045b4c2f9063e99083d2dbff48269db4ac2)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
4use Fisharebest\Webtrees\Http\RequestHandlers\ModulesAllPage;
5use Fisharebest\Webtrees\I18N;
6use Fisharebest\Webtrees\Tree;
7use Illuminate\Support\Collection;
8
9/**
10 * @var Collection<int,Tree> $all_trees
11 * @var array<int,string>    $ancestors_options
12 * @var string               $default_ancestors
13 * @var string               $default_recursion
14 * @var array<int,string>    $recursion_options
15 * @var string               $title
16 */
17
18?>
19
20<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), route(ModulesAllPage::class) => I18N::translate('Modules'), $title]]) ?>
21
22<h1><?= $title ?></h1>
23<p>
24    <?= I18N::translate('Searching for all possible relationships can take a lot of time in complex trees.') ?>
25</p>
26
27<form method="post">
28    <?php foreach ($all_trees as $tree) : ?>
29        <h2><?= e($tree->title()) ?></h2>
30        <div class="row mb-3">
31            <label class="col-sm-3 col-form-label" for="relationship-ancestors-<?= $tree->id() ?>">
32                <?= /* I18N: Configuration option */
33                I18N::translate('Relationships') ?>
34            </label>
35            <div class="col-sm-9">
36                <?= view('components/select', ['name' => 'relationship-ancestors-' . $tree->id(), 'selected' => $tree->getPreference('RELATIONSHIP_ANCESTORS', $default_ancestors), 'options' => $ancestors_options]) ?>
37            </div>
38        </div>
39
40        <fieldset class="row mb-3">
41            <legend class="col-form-label col-sm-3">
42                <?= /* I18N: Configuration option */
43                I18N::translate('How much recursion to use when searching for relationships') ?>
44            </legend>
45            <div class="col-sm-9">
46                <?= view('components/radios-inline', ['name' => 'relationship-recursion-' . $tree->id(), 'options' => $recursion_options, 'selected' => (int) $tree->getPreference('RELATIONSHIP_RECURSION', $default_recursion)]) ?>
47            </div>
48        </fieldset>
49    <?php endforeach ?>
50
51    <div class="row mb-3">
52        <div class="offset-sm-3 col-sm-9">
53            <button type="submit" class="btn btn-primary">
54                <?= view('icons/save') ?>
55                <?= I18N::translate('save') ?>
56            </button>
57        </div>
58    </div>
59
60    <?= csrf_field() ?>
61</form>
62