pageHeader() ->addExternalJavascript(WT_STATIC_URL.'js/autocomplete.js') ->addInlineJavascript('var pastefield; function paste_id(value) { pastefield.value=value; }'); // For the "find indi" link echo '

', $controller->getPageTitle(), '

'; echo '
'; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'; echo WT_I18N::translate('Individual'), ''; echo ' '; echo print_findindi_link('rootid'); echo ''; echo WT_I18N::translate('Box width'), ''; echo '%'; echo WT_I18N::translate('Layout'); echo ''; echo 'chart_style==0) { echo ' checked="checked"'; } echo '>', WT_I18N::translate('List'); echo '
chart_style==1) { echo ' checked="checked"'; } echo '>', WT_I18N::translate('Booklet'); echo '
chart_style==2) { echo ' checked="checked"'; } echo '>', WT_I18N::translate('Individuals'); echo '
chart_style==3) { echo ' checked="checked"'; } echo '>', WT_I18N::translate('Families'); echo '
'; echo ''; echo '
'; echo WT_I18N::translate('Generations'), ''; echo WT_I18N::translate('Show details'); echo '
'; if ($controller->error_message) { echo '

', $controller->error_message, '

'; exit; } switch ($controller->chart_style) { case 0: //-- list echo ''; break; case 1: //-- booklet echo '
'; $show_cousins = true; $controller->print_child_family($controller->root, $controller->generations); echo '
'; break; case 2: //-- Individual list $descendants=indi_desc($controller->root, $controller->generations, array()); echo '
'; echo format_indi_table($descendants, WT_I18N::translate('Descendants of %s', $controller->name)); echo '
'; break; case 3: //-- Family list $descendants=fam_desc($controller->root, $controller->generations, array()); echo '
'; echo format_fam_table($descendants, WT_I18N::translate('Descendants of %s', $controller->name)); echo '
'; break; } echo '
';// close #descendancy-page 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 ($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; }