';
echo "";
$numkids = 0;
$families = $person->getSpouseFamilies();
$famNum = 0;
$children = array();
if ($count < $this->dgenerations) {
// Put all of the children in a common array
foreach ($families as $family) {
$famNum++;
foreach ($family->getChildren() as $child) {
$children[] = $child;
}
}
$ct = count($children);
if ($ct > 0) {
echo "";
for ($i = 0; $i < $ct; $i++) {
$person2 = $children[$i];
$chil = $person2->getXref();
echo '';
echo '';
$kids = $this->printDescendency($person2, $count + 1, $showNav);
$numkids += $kids;
echo ' | ';
// Print the lines
if ($ct > 1) {
if ($i == 0) {
// First child
echo " | ";
} elseif ($i == $ct - 1) {
// Last child
echo " | ";
} else {
// Middle child
echo 'parameter('image-spacer') . '\' width="3"> | ';
}
}
echo ' ';
}
echo ' ';
}
echo ' | ';
echo '';
}
// Print the descendency expansion arrow
if ($count == $this->dgenerations) {
$numkids = 1;
$tbwidth = $this->getBoxDimensions()->width + 16;
for ($j = $count; $j < $this->dgenerations; $j++) {
echo "
| ";
}
$kcount = 0;
foreach ($families as $family) {
$kcount += $family->getNumberOfChildren();
}
if ($kcount == 0) {
echo " | ";
} else {
printf(self::LINK, $this->left_arrow, $pid, 'desc', $this->showFull(), $this->show_spouse);
//-- move the arrow up to line up with the correct box
if ($this->show_spouse) {
echo str_repeat('
', count($families));
}
echo " | ";
}
}
echo '';
FunctionsPrint::printPedigreePerson($person, $this->showFull());
echo ' | ';
//----- Print the spouse
if ($this->show_spouse) {
foreach ($families as $family) {
echo " | ";
FunctionsPrint::printPedigreePerson($family->getSpouse($person), $this->showFull());
$numkids++;
echo " | | ";
}
//-- add offset divs to make things line up better
if ($count == $this->dgenerations) {
echo "
";
}
}
echo " | ";
// For the root person, print a down arrow that allows changing the root of tree
if ($showNav && $count == 1) {
if ($person->canShowName()) {
// -- print left arrow for decendants so that we can move down the tree
$famids = $person->getSpouseFamilies();
//-- make sure there is more than 1 child in the family with parents
$cfamids = $person->getChildFamilies();
$num = 0;
foreach ($cfamids as $family) {
$num += $family->getNumberOfChildren();
}
if ($num > 0) {
echo '';
echo ' ';
echo ' ';
echo ' ';
foreach ($famids as $family) {
echo "" . I18N::translate('Family') . "";
$spouse = $family->getSpouse($person);
if ($spouse) {
printf(self::SWITCH_LINK, $spouse->getXref(), $this->show_spouse, $this->showFull(), $this->generations, $spouse->getFullName());
}
foreach ($family->getChildren() as $child) {
printf(self::SWITCH_LINK, $child->getXref(), $this->show_spouse, $this->showFull(), $this->generations, $child->getFullName());
}
}
//-- print the siblings
foreach ($cfamids as $family) {
if ($family->getHusband() || $family->getWife()) {
echo "" . I18N::translate('Parents') . "";
$husb = $family->getHusband();
if ($husb) {
printf(self::SWITCH_LINK, $husb->getXref(), $this->show_spouse, $this->showFull(), $this->generations, $husb->getFullName());
}
$wife = $family->getWife();
if ($wife) {
printf(self::SWITCH_LINK, $wife->getXref(), $this->show_spouse, $this->showFull(), $this->generations, $wife->getFullName());
}
}
// filter out root person from children array so only siblings remain
$siblings = array_filter($family->getChildren(), function (Individual $item) use ($pid) {
return $item->getXref() != $pid;
});
$num = count($siblings);
if ($num) {
echo "";
echo $num > 1 ? I18N::translate('Siblings') : I18N::translate('Sibling');
echo "";
foreach ($siblings as $child) {
printf(self::SWITCH_LINK, $child->getXref(), $this->show_spouse, $this->showFull(), $this->generations, $child->getFullName());
}
}
}
echo ' |
';
echo ' ';
echo ' ';
}
}
}
echo ' |