pageHeader();
if ($ENABLE_AUTOCOMPLETE) require WT_ROOT.'js/autocomplete.js.htm';
// LightBox
if (WT_USE_LIGHTBOX) {
require WT_ROOT.WT_MODULES_DIR.'lightbox/functions/lb_call_js.php';
}
echo '
';
echo '', WT_I18N::translate('Ancestors of %s', $controller->name), help_link('ancestry_chart'), '';
// -- print the form to change the number of displayed generations
echo WT_JS_START, 'var pastefield; function paste_id(value) {pastefield.value=value;}', WT_JS_END;
?>
| |
|
', WT_I18N::translate('Click on any of the boxes to get more information about that person.'), '
';
}
switch ($controller->chart_style) {
case 0:
// List
$pidarr=array();
echo '';
$controller->print_child_ascendancy(WT_Person::getInstance($controller->rootid), 1, $OLD_PGENS-1);
echo '
';
echo '
';
break;
case 1:
// TODO: this should be a parameter to a function, not a global
$show_cousins=$controller->show_cousins;
echo '';
// Booklet
// first page : show indi facts
print_pedigree_person(WT_Person::getInstance($controller->rootid), 1, 1);
// expand the layer
echo WT_JS_START, 'expandbox("', $controller->rootid, '.1", 2);', WT_JS_END;
// process the tree
$treeid=ancestry_array($controller->rootid, $PEDIGREE_GENERATIONS-1);
foreach ($treeid as $i=>$pid) {
if ($pid) {
$person=WT_Person::getInstance($pid);
if ($person) {
foreach ($person->getChildFamilies() as $family) {
print_sosa_family($family->getXref(), $pid, $i);
}
}
}
}
echo '
';
break;
case 2:
// Individual list
$treeid=ancestry_array($controller->rootid, $PEDIGREE_GENERATIONS);
echo '';
print_indi_table($treeid, 'sosa');
echo '
';
break;
case 3:
// Family list
$treeid=ancestry_array($controller->rootid, $PEDIGREE_GENERATIONS-1);
$famlist=array();
foreach ($treeid as $pid) {
$person=WT_Person::getInstance($pid);
if (is_null($person)) {
continue;
}
foreach ($person->getChildFamilies() as $famc) {
$famlist[$famc->getXref()]=$famc;
}
}
echo '';
print_fam_table($famlist, WT_I18N::translate('Ancestors of %s', $controller->name));
echo '
';
break;
}