', $this->arrows->menu);
foreach ($families as $family) {
$html .= '' . I18N::translate('Family') . '';
$spouse = $family->getSpouse($this->root);
if ($spouse) {
$html .= sprintf(self::MENU_ITEM, $spouse->getXref(), $this->generations, $this->orientation, 'name1', $spouse->getFullName());
}
$children = $family->getChildren();
foreach ($children as $sibling) {
$html .= sprintf(self::MENU_ITEM, $sibling->getXref(), $this->generations, $this->orientation, 'name1', $sibling->getFullName());
}
}
//-- echo the siblings
foreach ($this->root->getChildFamilies() as $family) {
$siblings = array_filter($family->getChildren(), function (Individual $item) {
return $this->root->getXref() !== $item->getXref();
});
if (!empty($siblings)) {
$html .= '';
$html .= count($siblings) > 1 ? I18N::translate('Siblings') : I18N::translate('Sibling');
$html .= '';
foreach ($siblings as $sibling) {
$html .= sprintf(self::MENU_ITEM, $sibling->getXref(), $this->generations, $this->orientation, 'name1', $sibling->getFullName());
}
}
}
$html .=
'
' . // #childbox-pedigree
'
'; // #childarrow
}
return $html;
}
/**
* Function gotoPreviousGen
*
* Create a link to generate a new chart based on the correct parent of the individual with this index
*
* @param int $index
*
* @return string
*/
public function gotoPreviousGen($index) {
$html = '';
if ($this->chartHasAncestors) {
if ($this->nodes[$index]['indi'] && $this->nodes[$index]['indi']->getChildFamilies()) {
$html .= '';
$rootParentId = 1;
if ($index > (int) ($this->treesize / 2) + (int) ($this->treesize / 4)) {
$rootParentId++;
}
$html .= sprintf(self::MENU_ITEM, $this->nodes[$rootParentId]['indi']->getXref(), $this->generations, $this->orientation, $this->arrows->prevGen, '');
$html .= '
';
} else {
$html .= '