xref: /webtrees/resources/views/fact-parent-age.phtml (revision 1270d2767576ed4a83917769b0ee3613e3b010bf)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Age;
6use Fisharebest\Webtrees\I18N;
7
8/**
9 * @var Age    $age
10 * @var bool   $died
11 * @var string $sex
12 */
13
14?>
15
16<?php if ($sex === 'F') : ?>
17    <?php if ($died) : ?>
18        <span title="<?= I18N::translate('Death of a mother') ?>" class="parentdeath">
19            <small><?= view('icons/sex', ['sex' => $sex]) ?></small><?= I18N::number($age->ageYears()) ?>
20        </span>
21    <?php else : ?>
22        <span title="<?= I18N::translate('Mother’s age') ?>">
23            <small><?= view('icons/sex', ['sex' => $sex]) ?></small><?= I18N::number($age->ageYears()) ?>
24        </span>
25    <?php endif ?>
26<?php elseif ($sex === 'M') : ?>
27    <?php if ($died) : ?>
28        <span title="<?= I18N::translate('Death of a father') ?>" class="parentdeath">
29            <small><?= view('icons/sex', ['sex' => $sex]) ?></small><?= I18N::number($age->ageYears()) ?>
30        </span>
31    <?php else : ?>
32        <span title="<?= I18N::translate('Father’s age') ?>">
33            <small><?= view('icons/sex', ['sex' => $sex]) ?></small><?= I18N::number($age->ageYears()) ?>
34        </span>
35    <?php endif ?>
36<?php else : ?>
37    <?php if ($died) : ?>
38        <span title="<?= I18N::translate('Death of a parent') ?>" class="parentdeath">
39            <small><?= view('icons/sex', ['sex' => $sex]) ?></small><?= I18N::number($age->ageYears()) ?>
40        </span>
41    <?php else : ?>
42        <span title="<?= I18N::translate('Parent’s age') ?>">
43            <small><?= view('icons/sex', ['sex' => $sex]) ?></small><?= I18N::number($age->ageYears()) ?>
44        </span>
45    <?php endif ?>
46<?php endif ?>
47