/** * Print a lineage node, recursively. * @param LineageNode $node */ private function printLineage(LineageNode $node) { echo '<ul>'; $fam_nodes = $node->getFamiliesNodes(); if (count($fam_nodes) > 0) { $is_first_family = true; foreach ($fam_nodes as $fam) { $node_indi = $node->getIndividual(); echo '<li>'; if ($is_first_family) { echo FunctionsPrint::htmlIndividualForList($node_indi); } else { echo FunctionsPrint::htmlIndividualForList($node_indi, false); } //Get individual's spouse $dfam = new Family($fam); $spouse = $dfam->getSpouseById($node_indi); //Print the spouse if relevant if ($spouse) { $marrdate = I18N::translate('yes'); $marryear = ''; echo ' <a href="' . $fam->getHtmlUrl() . '">'; if ($fam->getMarriageYear()) { $marrdate = strip_tags($fam->getMarriageDate()->Display()); $marryear = $fam->getMarriageYear(); } echo '<span class="details1" title="' . $marrdate . '"><i class="icon-rings"></i>' . $marryear . '</span></a> '; echo FunctionsPrint::htmlIndividualForList($spouse); } foreach ($fam_nodes[$fam] as $child_node) { if ($child_node) { $this->printLineage($child_node); } else { echo '<ul><li><strong>…</strong></li></ul>'; } } $is_first_family = false; } } else { echo '<li>'; echo \MyArtJaub\Webtrees\Functions\FunctionsPrint::htmlIndividualForList($node->getIndividual()); if ($node->hasFollowUpSurname()) { $url_base = WT_SCRIPT_NAME . '?mod=' . \MyArtJaub\Webtrees\Constants::MODULE_MAJ_PATROLIN_NAME . '&mod_action=Lineage'; echo ' ' . '<a href="' . $url_base . '&surname=' . rawurlencode($node->getFollowUpSurname()) . '&ged=' . $this->data->get('tree')->getNameUrl() . '">' . '(' . I18N::translate('Go to %s lineages', $node->getFollowUpSurname()) . ')' . '</a>'; } echo '</li>'; } echo '</ul>'; }