/** * Print a child family * * @param WT_Individual $person * @param int $depth the descendancy depth to show * @param string $label * @param string $gpid * * @return void */ function print_child_family(WT_Individual $person, $depth, $label = '1.', $gpid = '') { global $personcount; if ($depth < 2) { return; } foreach ($person->getSpouseFamilies() as $family) { print_sosa_family($family->getXref(), '', -1, $label, $person->getXref(), $gpid, $personcount); $personcount++; $i = 1; foreach ($family->getChildren() as $child) { $this->print_child_family($child, $depth - 1, $label . $i++ . '.', $person->getXref()); } } }
/** * print a child family * * @param string $pid individual Gedcom Id * @param int $depth the descendancy depth to show */ function print_child_family(&$person, $depth, $label = "1.", $gpid = "") { global $personcount; if (is_null($person)) { return; } $families = $person->getSpouseFamilies(); if ($depth < 1) { return; } foreach ($families as $famid => $family) { print_sosa_family($family->getXref(), "", -1, $label, $person->getXref(), $gpid, $personcount); $personcount++; $children = $family->getChildren(); $i = 1; foreach ($children as $child) { $this->print_child_family($child, $depth - 1, $label . $i++ . ".", $person->getXref()); } } }
// expand the layer echo PGV_JS_START, 'expandbox("', $controller->rootid, '.1", 2);', PGV_JS_END; // process the tree $treeid = ancestry_array($controller->rootid, $PEDIGREE_GENERATIONS - 1); foreach ($treeid as $i => $pid) { if ($pid) { $person = Person::getInstance($pid); if (!is_null($person)) { $famids = $person->getChildFamilies(); foreach ($famids as $famid => $family) { $parents = find_parents_in_record($family->getGedcomRecord()); if ($parents) { print_sosa_family($famid, $pid, $i); } elseif ($i == 1) { // show empty family only if it is the first and only one print_sosa_family('', $pid, $i); } } } } } break; case 2: // Individual list $treeid = ancestry_array($controller->rootid, $PEDIGREE_GENERATIONS); echo '<div class="center">'; print_indi_table($treeid, $pgv_lang["ancestry_chart"] . ' : ' . PrintReady($controller->name), 'sosa'); echo '</div>'; break; case 3: // Family list
break; case 1: // TODO: this should be a parameter to a function, not a global $show_cousins = $controller->show_cousins; echo '<div id="ancestry_chart">'; // Booklet // first page : show indi facts print_pedigree_person($controller->root, 1, 1); // process the tree $treeid = ancestry_array($controller->root->getXref(), $PEDIGREE_GENERATIONS - 1); foreach ($treeid as $i => $pid) { if ($pid) { $person = WT_Individual::getInstance($pid); if ($person) { foreach ($person->getChildFamilies() as $family) { print_sosa_family($family->getXref(), $pid, $i); } } } } echo '</div>'; break; case 2: // Individual list $treeid = ancestry_array($controller->root->getXref(), $PEDIGREE_GENERATIONS); echo '<div id="ancestry-list">', format_indi_table($treeid, 'sosa'), '</div>'; break; case 3: // Family list $treeid = ancestry_array($controller->root->getXref(), $PEDIGREE_GENERATIONS - 1); $famlist = array();