.
*/
/**
* Defined in session.php
*
* @global Tree $WT_TREE
*/
global $WT_TREE;
define('WT_SCRIPT_NAME', 'ancestry.php');
require './includes/session.php';
$MAX_PEDIGREE_GENERATIONS = $WT_TREE->getPreference('MAX_PEDIGREE_GENERATIONS');
$controller = new AncestryController;
$controller
->pageHeader()
->addExternalJavascript(WT_AUTOCOMPLETE_JS_URL)
->addInlineJavascript('autocomplete();');
?>
getPageTitle(); ?>
error_message) {
echo '
', $controller->error_message, '
';
return;
}
switch ($controller->chart_style) {
case 0:
// List
$pidarr = array();
echo '
';
$controller->printChildAscendancy($controller->root, 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($controller->root);
// process the tree
$ancestors = $controller->sosaAncestors($PEDIGREE_GENERATIONS - 1);
$ancestors = array_filter($ancestors); // The SOSA array includes empty placeholders
foreach ($ancestors as $sosa => $individual) {
foreach ($individual->getChildFamilies() as $family) {
print_sosa_family($family->getXref(), $individual->getXref(), $sosa);
}
}
echo '
';
break;
case 2:
// Individual list
$ancestors = $controller->sosaAncestors($PEDIGREE_GENERATIONS);
$ancestors = array_filter($ancestors); // The SOSA array includes empty placeholders
echo '
', format_indi_table($ancestors, 'sosa'), '
';
break;
case 3:
// Family list
$ancestors = $controller->sosaAncestors($PEDIGREE_GENERATIONS - 1);
$ancestors = array_filter($ancestors); // The SOSA array includes empty placeholders
$families = array();
foreach ($ancestors as $individual) {
foreach ($individual->getChildFamilies() as $family) {
$families[$family->getXref()] = $family;
}
}
echo '
', format_fam_table($families), '
';
break;
}
echo '
';