xref: /webtrees/resources/views/modules/pedigree-chart/previous.phtml (revision 10e0649788c8d7d4974d81c048ca2b225df8f22e)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\I18N;
6
7/**
8 * @var string        $icon
9 * @var array<string> $siblings
10 * @var array<string> $spouses
11 * @var array<string> $children
12 */
13
14?>
15
16<div class="dropdown px-2">
17    <a href="#" role="button" id="pedigree-previous-link" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
18        <?= $icon ?>
19    </a>
20    <div class="dropdown-menu" aria-labelledby="pedigree-previous-link">
21        <?php if (count($siblings) > 1) : ?>
22            <strong class="dropdown-item-text"><?= I18N::translate('Siblings') ?></strong>
23        <?php elseif (count($siblings) > 0) : ?>
24            <strong class="dropdown-item-text"><?= I18N::translate('Sibling') ?></strong>
25        <?php endif ?>
26        <?php foreach ($siblings as $sibling) : ?>
27            <?= $sibling ?>
28        <?php endforeach ?>
29
30        <?php if (count($spouses) > 1) : ?>
31            <strong class="dropdown-item-text"><?= I18N::translate('Spouses') ?></strong>
32        <?php elseif (count($spouses) > 0) : ?>
33            <strong class="dropdown-item-text"><?= I18N::translate('Spouse') ?></strong>
34        <?php endif ?>
35        <?php foreach ($spouses as $spouse) : ?>
36            <?= $spouse ?>
37        <?php endforeach ?>
38
39        <?php if (count($children) > 1) : ?>
40            <strong class="dropdown-item-text"><?= I18N::translate('Children') ?></strong>
41        <?php elseif (count($children) > 0) : ?>
42            <strong class="dropdown-item-text"><?= I18N::translate('Child') ?></strong>
43        <?php endif ?>
44        <?php foreach ($children as $child) : ?>
45            <?= $child ?>
46        <?php endforeach ?>
47    </div>
48</div>
49