', $this->arrows->menu);
foreach ($famids as $family) {
$html .= '' . I18N::translate('Family') . '';
$spouse = $family->getSpouse($this->root);
if ($spouse) {
$html .= sprintf(self::MENU_ITEM, $spouse->getXref(), $this->showFull(), $this->generations, $this->orientation, 'name1', $spouse->getFullName());
}
$children = $family->getChildren();
foreach ($children as $child) {
$html .= sprintf(self::MENU_ITEM, $child->getXref(), $this->showFull(), $this->generations, $this->orientation, 'name1', $child->getFullName());
}
}
//-- echo the siblings
$tmp = $this->root; // PHP5.3 cannot use $this in closures
foreach ($this->root->getChildFamilies() as $family) {
$siblings = array_filter($family->getChildren(), function (Individual $item) use ($tmp) {
return $tmp->getXref() !== $item->getXref();
});
$num = count($siblings);
if ($num) {
$html .= '';
$html .= $num > 1 ? I18N::translate('Siblings') : I18N::translate('Sibling');
$html .= '';
foreach ($siblings as $child) {
$html .= sprintf(self::MENU_ITEM, $child->getXref(), $this->showFull(), $this->generations, $this->orientation, 'name1', $child->getFullName());
}
}
}
$html .=
'
' . // #childbox
'
'; // #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->showFull(), $this->generations, $this->orientation, $this->arrows->prevGen, '');
$html .= '
';
} else {
$html .= '