xref: /webtrees/resources/views/modules/relationships-chart/config.phtml (revision 10e0649788c8d7d4974d81c048ca2b225df8f22e)
10c0910bfSGreg Roach<?php
29b5537c3SGreg Roach
3*10e06497SGreg Roachdeclare(strict_types=1);
4*10e06497SGreg Roach
50c0910bfSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ControlPanel;
63213013eSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\ModulesAllPage;
70c0910bfSGreg Roachuse Fisharebest\Webtrees\I18N;
87c2c99faSGreg Roachuse Fisharebest\Webtrees\Tree;
97c2c99faSGreg Roachuse Illuminate\Support\Collection;
107c2c99faSGreg Roach
117c2c99faSGreg Roach/**
1236779af1SGreg Roach * @var Collection<int,Tree> $all_trees
137c2c99faSGreg Roach * @var array<int,string>    $ancestors_options
147c2c99faSGreg Roach * @var string               $default_ancestors
157c2c99faSGreg Roach * @var string               $default_recursion
167c2c99faSGreg Roach * @var array<int,string>    $recursion_options
177c2c99faSGreg Roach * @var string               $title
187c2c99faSGreg Roach */
190c0910bfSGreg Roach
200c0910bfSGreg Roach?>
210c0910bfSGreg Roach
223213013eSGreg Roach<?= view('components/breadcrumbs', ['links' => [route(ControlPanel::class) => I18N::translate('Control panel'), route(ModulesAllPage::class) => I18N::translate('Modules'), $title]]) ?>
239b5537c3SGreg Roach
249b5537c3SGreg Roach<h1><?= $title ?></h1>
259b5537c3SGreg Roach<p>
269b5537c3SGreg Roach    <?= I18N::translate('Searching for all possible relationships can take a lot of time in complex trees.') ?>
279b5537c3SGreg Roach</p>
289b5537c3SGreg Roach
299b5537c3SGreg Roach<form method="post">
309b5537c3SGreg Roach    <?php foreach ($all_trees as $tree) : ?>
319b5537c3SGreg Roach        <h2><?= e($tree->title()) ?></h2>
329e3c2cf9SGreg Roach        <div class="row mb-3">
339b5537c3SGreg Roach            <label class="col-sm-3 col-form-label" for="relationship-ancestors-<?= $tree->id() ?>">
349b5537c3SGreg Roach                <?= /* I18N: Configuration option */
359b5537c3SGreg Roach                I18N::translate('Relationships') ?>
369b5537c3SGreg Roach            </label>
379b5537c3SGreg Roach            <div class="col-sm-9">
38c9e11c2aSGreg Roach                <?= view('components/select', ['name' => 'relationship-ancestors-' . $tree->id(), 'selected' => $tree->getPreference('RELATIONSHIP_ANCESTORS', $default_ancestors), 'options' => $ancestors_options]) ?>
399b5537c3SGreg Roach            </div>
409b5537c3SGreg Roach        </div>
419b5537c3SGreg Roach
429e3c2cf9SGreg Roach        <fieldset class="row mb-3">
439b5537c3SGreg Roach            <legend class="col-form-label col-sm-3">
449b5537c3SGreg Roach                <?= /* I18N: Configuration option */
459b5537c3SGreg Roach                I18N::translate('How much recursion to use when searching for relationships') ?>
469b5537c3SGreg Roach            </legend>
479b5537c3SGreg Roach            <div class="col-sm-9">
48ff207a43SGreg Roach                <?= view('components/radios-inline', ['name' => 'relationship-recursion-' . $tree->id(), 'options' => $recursion_options, 'selected' => (int) $tree->getPreference('RELATIONSHIP_RECURSION', $default_recursion)]) ?>
499b5537c3SGreg Roach            </div>
509b5537c3SGreg Roach        </fieldset>
519b5537c3SGreg Roach    <?php endforeach ?>
529b5537c3SGreg Roach
539e3c2cf9SGreg Roach    <div class="row mb-3">
549b5537c3SGreg Roach        <div class="offset-sm-3 col-sm-9">
559b5537c3SGreg Roach            <button type="submit" class="btn btn-primary">
569b5537c3SGreg Roach                <?= view('icons/save') ?>
579b5537c3SGreg Roach                <?= I18N::translate('save') ?>
589b5537c3SGreg Roach            </button>
599b5537c3SGreg Roach        </div>
609b5537c3SGreg Roach    </div>
6181443e3cSGreg Roach
6281443e3cSGreg Roach    <?= csrf_field() ?>
639b5537c3SGreg Roach</form>
64