show_full = WT_Filter::getInteger('show_full', 0, 1, $PEDIGREE_FULL_DETAILS); $this->chart_style = WT_Filter::getInteger('chart_style', 0, 3, 0); $this->generations = WT_Filter::getInteger('generations', 2, $MAX_DESCENDANCY_GENERATIONS, $DEFAULT_PEDIGREE_GENERATIONS); $this->box_width = WT_Filter::getInteger('box_width', 50, 300, 100); // This is passed as a global. A parameter would be better... $show_full=$this->show_full; if (!isset($this->personcount)) $this->personcount = 1; // -- size of the detailed boxes based upon optional width parameter $Dbwidth = ($this->box_width*$bwidth)/100; $Dbheight = ($this->box_width*$bheight)/100; $bwidth = $Dbwidth; $bheight = $Dbheight; // -- adjust size of the compact box if (!$this->show_full) { $bwidth = $cbwidth; $bheight = $cbheight; } $pbwidth = $bwidth+12; $pbheight = $bheight+14; // Validate form variables if (strlen($this->name)<30) { $this->cellwidth=420; } else { $this->cellwidth=(strlen($this->name)*14); } if ($this->root && $this->root->canShowName()) { $this->setPageTitle( /* I18N: %s is an individual’s name */ WT_I18N::translate('Descendants of %s', $this->root->getFullName()) ); } else { $this->setPageTitle(WT_I18N::translate('Descendants')); } } /** * 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; 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 descendancy * * @param string $pid individual Gedcom Id * @param int $depth the descendancy depth to show */ function print_child_descendancy($person, $depth) { global $WT_IMAGES, $Dindent, $personcount; if (is_null($person)) return; //print_r($person); echo "
| ";
if ($depth==$this->generations) echo " | ";
else {
echo " | "; } print_pedigree_person($person, 1, 0, $personcount); echo ' | '; // check if child has parents and add an arrow echo ''; echo ' | ';
foreach ($person->getChildFamilies() as $cfamily) {
foreach ($cfamily->getSpouses() as $parent) {
print_url_arrow($parent->getXref().$personcount.$person->getXref(), '?rootid='.$parent->getXref().'&generations='.$this->generations.'&chart_style='.$this->chart_style.'&show_full='.$this->show_full.'&box_width='.$this->box_width.'&ged='.WT_GEDURL, WT_I18N::translate('Start at parents'), 2);
$personcount++;
// only show the arrow for one of the parents
break;
}
}
// d'Aboville child number
$level =$this->generations-$depth;
if ($this->show_full) echo ' '; echo ''; //needed so that RTL languages will display this properly if (!isset($this->dabo_num[$level])) $this->dabo_num[$level]=0; $this->dabo_num[$level]++; $this->dabo_num[$level+1]=0; $this->dabo_sex[$level]=$person->getSex(); for ($i=0; $i<=$level;$i++) { $isf=$this->dabo_sex[$i]; if ($isf=="M") $isf=""; if ($isf=="U") $isf="NN"; echo " ".$this->dabo_num[$i]." "; if ($i<$level) echo "."; } echo ""; echo " |
| '; print_pedigree_person($spouse, 1, 0, $personcount); echo ' | '; // check if spouse has parents and add an arrow echo ''; echo ' | ';
if ($spouse) {
foreach ($spouse->getChildFamilies() as $cfamily) {
foreach ($cfamily->getSpouses() as $parent) {
print_url_arrow($parent->getXref().$personcount.$person->getXref(), '?rootid='.$parent->getXref().'&generations='.$this->generations.'&chart_style='.$this->chart_style.'&show_full='.$this->show_full.'&box_width='.$this->box_width.'&ged='.WT_GEDURL, WT_I18N::translate('Start at parents'), 2);
$personcount++;
// only show the arrow for one of the parents
break;
}
}
}
if ($this->show_full) echo ' '; echo ' |
| '; if ($children) { echo WT_Gedcom_Tag::getLabel('NCHI').': '.count($children); } else { // Distinguish between no children (NCHI 0) and no recorded // children (no CHIL records) if (strpos($family->getGedcom(), '\n1 NCHI 0')) { echo WT_Gedcom_Tag::getLabel('NCHI').': '.count($children); } else { echo WT_I18N::translate('No children'); } } echo ' | ||