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