xref: /webtrees/resources/views/modules/relationships-chart/config.phtml (revision 6bf0af166b27d50bc0dc213975b1116b197adb10)
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<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 form-group">
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="form-group">
42            <div class="row">
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            </div>
51        </fieldset>
52    <?php endforeach ?>
53
54    <div class="row form-group">
55        <div class="offset-sm-3 col-sm-9">
56            <button type="submit" class="btn btn-primary">
57                <?= view('icons/save') ?>
58                <?= I18N::translate('save') ?>
59            </button>
60        </div>
61    </div>
62</form>
63