本文整理汇总了PHP中Fisharebest\Webtrees\Individual::getLifeSpan方法的典型用法代码示例。如果您正苦于以下问题:PHP Individual::getLifeSpan方法的具体用法?PHP Individual::getLifeSpan怎么用?PHP Individual::getLifeSpan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fisharebest\Webtrees\Individual
的用法示例。
在下文中一共展示了Individual::getLifeSpan方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: drawPersonName
/**
* Draw a person name preceded by sex icon, with parents as tooltip
*
* @param Individual $individual an individual
* @param string $dashed if = 'dashed' print dashed top border to separate multiple spuses
*
* @return string
*/
private function drawPersonName(Individual $individual, $dashed = '')
{
if ($this->all_partners === 'true') {
$family = $individual->getPrimaryChildFamily();
if ($family) {
$family_name = strip_tags($family->getFullName());
} else {
$family_name = I18N::translateContext('unknown family', 'unknown');
}
switch ($individual->getSex()) {
case 'M':
$title = ' title="' . I18N::translate('Son of %s', $family_name) . '"';
break;
case 'F':
$title = ' title="' . I18N::translate('Daughter of %s', $family_name) . '"';
break;
default:
$title = ' title="' . I18N::translate('Child of %s', $family_name) . '"';
break;
}
} else {
$title = '';
}
$sex = $individual->getSex();
return '<div class="tv' . $sex . ' ' . $dashed . '"' . $title . '><a href="' . $individual->getHtmlUrl() . '"></a>' . $individual->getFullName() . ' <span class="dates">' . $individual->getLifeSpan() . '</span></div>';
}
示例2: individualBoxSmall
/**
* Display an individual in a box - for charts, etc.
*
* @param Individual $individual
*
* @return string
*/
public function individualBoxSmall(Individual $individual)
{
$personBoxClass = array_search($individual->getSex(), array('person_box' => 'M', 'person_boxF' => 'F', 'person_boxNN' => 'U'));
if ($individual->getTree()->getPreference('SHOW_HIGHLIGHT_IMAGES')) {
$thumbnail = $individual->displayImage();
} else {
$thumbnail = '';
}
return '<div data-pid="' . $individual->getXref() . '" class="person_box_template ' . $personBoxClass . ' iconz box-style0" style="width: ' . $this->parameter('compact-chart-box-x') . 'px; min-height: ' . $this->parameter('compact-chart-box-y') . 'px">' . '<div class="compact_view">' . $thumbnail . '<a href="' . $individual->getHtmlUrl() . '">' . '<span class="namedef name0">' . $individual->getFullName() . '</span>' . '</a>' . '<div class="inout2 details0">' . $individual->getLifeSpan() . '</div>' . '</div>' . '<div class="inout"></div>' . '</div>';
}
示例3: getPersonLi
/**
* Format an individual in a list.
*
* @param Individual $person
* @param int $generations
*
* @return string
*/
public function getPersonLi(Individual $person, $generations = 0)
{
$icon = $generations > 0 ? 'icon-minus' : 'icon-plus';
$lifespan = $person->canShow() ? '(' . $person->getLifeSpan() . ')' : '';
$spouses = $generations > 0 ? $this->loadSpouses($person, 0) : '';
return '<li class="sb_desc_indi_li">' . '<a class="sb_desc_indi" href="module.php?mod=' . $this->getName() . '&mod_action=descendants&xref=' . $person->getXref() . '">' . '<i class="plusminus ' . $icon . '"></i>' . $person->getSexImage() . $person->getFullName() . $lifespan . '</a>' . '<a class="icon-button_indi" href="' . $person->getHtmlUrl() . '"></a>' . '<div>' . $spouses . '</div>' . '</li>';
}