/** * Draw a person name preceded by sex icon, with parents as tooltip * * @param WT_Individual $individual an individual * @param string $dashed if = 'dashed' print dashed top border to separate multiple spuses * * @return string */ private function drawPersonName(WT_Individual $individual, $dashed = '') { if ($this->all_partners === 'true') { $family = $individual->getPrimaryChildFamily(); if ($family) { switch ($individual->getSex()) { case 'M': $title = ' title="' . strip_tags(WT_I18N::translate('Son of %s', $family->getFullName())) . '"'; break; case 'F': $title = ' title="' . strip_tags(WT_I18N::translate('Daughter of %s', $family->getFullName())) . '"'; break; case 'U': $title = ' title="' . strip_tags(WT_I18N::translate('Child of %s', $family->getFullName())) . '"'; break; } } else { $title = ''; } } 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>'; }
public function getPersonLi(WT_Individual $person, $generations = 0) { $icon = $generations > 0 ? 'icon-minus' : 'icon-plus'; $lifespan = $person->canShow() ? '(' . $person->getLifeSpan() . ')' : ''; $spouses = $generations > 0 ? $this->loadSpouses($person, 0) : ''; return sprintf('<li class="sb_desc_indi_li"> <a class="sb_desc_indi" href="module.php?mod=%s&mod_action=descendants&xref=%s"><i class="plusminus %s"></i>%s %s %s</a> <a class="icon-button_indi" href="%s"></a> %s <div>%s</div> </li>', $this->getName(), $person->getXref(), $icon, $person->getSexImage(), $person->getFullName(), $lifespan, $person->getHtmlUrl(), '', $spouses); }