xref: /webtrees/resources/views/modules/relationships-chart/config.phtml (revision e47dc774cba11c817773e1490719632c810d988e)
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    <?= csrf_field() ?>
29    <?php foreach ($all_trees as $tree) : ?>
30        <h2><?= e($tree->title()) ?></h2>
31        <div class="row mb-3">
32            <label class="col-sm-3 col-form-label" for="relationship-ancestors-<?= $tree->id() ?>">
33                <?= /* I18N: Configuration option */
34                I18N::translate('Relationships') ?>
35            </label>
36            <div class="col-sm-9">
37                <?= view('components/select', ['name' => 'relationship-ancestors-' . $tree->id(), 'selected' => $tree->getPreference('RELATIONSHIP_ANCESTORS', $default_ancestors), 'options' => $ancestors_options]) ?>
38            </div>
39        </div>
40
41        <fieldset class="row mb-3">
42            <legend class="col-form-label col-sm-3">
43                <?= /* I18N: Configuration option */
44                I18N::translate('How much recursion to use when searching for relationships') ?>
45            </legend>
46            <div class="col-sm-9">
47                <?= view('components/radios-inline', ['name' => 'relationship-recursion-' . $tree->id(), 'options' => $recursion_options, 'selected' => (int) $tree->getPreference('RELATIONSHIP_RECURSION', $default_recursion)]) ?>
48            </div>
49        </fieldset>
50    <?php endforeach ?>
51
52    <div class="row mb-3">
53        <div class="offset-sm-3 col-sm-9">
54            <button type="submit" class="btn btn-primary">
55                <?= view('icons/save') ?>
56                <?= I18N::translate('save') ?>
57            </button>
58        </div>
59    </div>
60</form>
61