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