xref: /webtrees/resources/views/modules/relationships-chart/config.phtml (revision 9e3c2cf9009c4c2140f50ddfc80b91f2f82cdce5)
10c0910bfSGreg Roach<?php
29b5537c3SGreg Roach
30c0910bfSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
43213013eSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ModulesAllPage;
50c0910bfSGreg Roachuse Fisharebest\Webtrees\I18N;
67c2c99faSGreg Roachuse Fisharebest\Webtrees\Tree;
77c2c99faSGreg Roachuse Illuminate\Support\Collection;
87c2c99faSGreg Roach
97c2c99faSGreg Roach/**
1036779af1SGreg Roach * @var Collection<int,Tree> $all_trees
117c2c99faSGreg Roach * @var array<int,string>    $ancestors_options
127c2c99faSGreg Roach * @var string               $default_ancestors
137c2c99faSGreg Roach * @var string               $default_recursion
147c2c99faSGreg Roach * @var array<int,string>    $recursion_options
157c2c99faSGreg Roach * @var string               $title
167c2c99faSGreg Roach */
170c0910bfSGreg Roach
180c0910bfSGreg Roach?>
190c0910bfSGreg Roach
203213013eSGreg Roach<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), route(ModulesAllPage::class) => I18N::translate('Modules'), $title]]) ?>
219b5537c3SGreg Roach
229b5537c3SGreg Roach<h1><?= $title ?></h1>
239b5537c3SGreg Roach<p>
249b5537c3SGreg Roach    <?= I18N::translate('Searching for all possible relationships can take a lot of time in complex trees.') ?>
259b5537c3SGreg Roach</p>
269b5537c3SGreg Roach
279b5537c3SGreg Roach<form method="post">
289b5537c3SGreg Roach    <?= csrf_field() ?>
299b5537c3SGreg Roach    <?php foreach ($all_trees as $tree) : ?>
309b5537c3SGreg Roach        <h2><?= e($tree->title()) ?></h2>
31*9e3c2cf9SGreg Roach        <div class="row mb-3">
329b5537c3SGreg Roach            <label class="col-sm-3 col-form-label" for="relationship-ancestors-<?= $tree->id() ?>">
339b5537c3SGreg Roach                <?= /* I18N: Configuration option */
349b5537c3SGreg Roach                I18N::translate('Relationships') ?>
359b5537c3SGreg Roach            </label>
369b5537c3SGreg Roach            <div class="col-sm-9">
37c9e11c2aSGreg Roach                <?= view('components/select', ['name' => 'relationship-ancestors-' . $tree->id(), 'selected' => $tree->getPreference('RELATIONSHIP_ANCESTORS', $default_ancestors), 'options' => $ancestors_options]) ?>
389b5537c3SGreg Roach            </div>
399b5537c3SGreg Roach        </div>
409b5537c3SGreg Roach
41*9e3c2cf9SGreg Roach        <fieldset class="row mb-3">
429b5537c3SGreg Roach            <legend class="col-form-label col-sm-3">
439b5537c3SGreg Roach                <?= /* I18N: Configuration option */
449b5537c3SGreg Roach                I18N::translate('How much recursion to use when searching for relationships') ?>
459b5537c3SGreg Roach            </legend>
469b5537c3SGreg Roach            <div class="col-sm-9">
47ff207a43SGreg Roach                <?= view('components/radios-inline', ['name' => 'relationship-recursion-' . $tree->id(), 'options' => $recursion_options, 'selected' => (int) $tree->getPreference('RELATIONSHIP_RECURSION', $default_recursion)]) ?>
489b5537c3SGreg Roach            </div>
499b5537c3SGreg Roach        </fieldset>
509b5537c3SGreg Roach    <?php endforeach ?>
519b5537c3SGreg Roach
52*9e3c2cf9SGreg Roach    <div class="row mb-3">
539b5537c3SGreg Roach        <div class="offset-sm-3 col-sm-9">
549b5537c3SGreg Roach            <button type="submit" class="btn btn-primary">
559b5537c3SGreg Roach                <?= view('icons/save') ?>
569b5537c3SGreg Roach                <?= I18N::translate('save') ?>
579b5537c3SGreg Roach            </button>
589b5537c3SGreg Roach        </div>
599b5537c3SGreg Roach    </div>
609b5537c3SGreg Roach</form>
61