init(); print_header($controller->name." ".i18n::translate('Descendancy chart')); if ($ENABLE_AUTOCOMPLETE) require WT_ROOT.'js/autocomplete.js.htm'; // LBox ===================================================================================== if (WT_USE_LIGHTBOX) { require WT_ROOT.'modules/lightbox/lb_defaultconfig.php'; require WT_ROOT.'modules/lightbox/functions/lb_call_js.php'; } // ========================================================================================== echo '

', i18n::translate('Descendancy chart'), ':
', PrintReady($controller->name), '

'; echo WT_JS_START; echo 'var pastefield; function paste_id(value) {pastefield.value=value;}'; echo WT_JS_END; $gencount=0; echo '
 
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo i18n::translate('Root Person ID'), help_link('desc_rootid'), ''; echo ''; print_findindi_link("pid", ""); echo ''; echo i18n::translate('Box width'), help_link('box_width'), ''; echo '%'; echo i18n::translate('Layout'), help_link('chart_style'); echo ''; echo 'chart_style==0) { echo ' checked="checked"'; } echo '/>', i18n::translate('List'); echo '
chart_style==1) { echo ' checked="checked"'; } echo '/>', i18n::translate('Booklet'); echo '
chart_style==2) { echo ' checked="checked"'; } echo ' />', i18n::translate('Individuals'); echo '
chart_style==3) { echo ' checked="checked"'; } echo ' />', i18n::translate('Families'); echo '
'; echo ''; echo '
'; echo i18n::translate('Generations'), help_link('desc_generations'), ''; echo i18n::translate('Show Details'), help_link('show_full'); echo '
'; echo '
'; if (is_null($controller->descPerson)) { echo '', i18n::translate('The requested GEDCOM record could not be found. This could be caused by a link to an invalid person or by a corrupt GEDCOM file.'), ''; } switch ($controller->chart_style) { case 0: //-- list if ($show_full==0) { echo '', i18n::translate('Click on any of the boxes to get more information about that person.'), '

'; } echo ''; break; case 1: //-- booklet if ($show_full==0) { echo '', i18n::translate('Click on any of the boxes to get more information about that person.'), '

'; } $show_cousins = true; $famids = find_sfamily_ids($controller->pid); if (count($famids)) { $controller->print_child_family($controller->descPerson, $controller->generations); } break; case 2: //-- Individual list $descendants=indi_desc($controller->descPerson, $controller->generations, array()); echo '
'; print_indi_table($descendants, i18n::translate('Descendancy chart').' : '.PrintReady($controller->name)); echo '
'; break; case 3: //-- Family list $descendants=fam_desc($controller->descPerson, $controller->generations, array()); echo '
'; print_fam_table($descendants, i18n::translate('Descendancy chart').' : '.PrintReady($controller->name)); echo '
'; break; } print_footer(); function indi_desc($person, $n, $array) { if ($n<1) { return $array; } $array[$person->getXref()]=$person; foreach ($person->getSpouseFamilies() as $family) { $spouse=$family->getSpouse($person); if (isset($spouse)) $array[$spouse->getXref()]=$spouse; foreach ($family->getChildren() as $child) { $array=indi_desc($child, $n-1, $array); } } return $array; } function fam_desc($person, $n, $array) { if ($n<1) { return $array; } foreach ($person->getSpouseFamilies() as $family) { $array[$family->getXref()]=$family; foreach ($family->getChildren() as $child) { $array=fam_desc($child, $n-1, $array); } } return $array; } ?>