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