getFullName(), $person2->getFullName()); } else { $title_string=WT_I18N::translate('Relationships'); } if ($person1) { $pid1=$person1->getXref(); // i1 => I1 } else { $pid1=''; } if (!empty($_SESSION["pid1"]) && $_SESSION["pid1"]!=$pid1) { unset($_SESSION["relationships"]); $path_to_find=0; } if ($person2) { $pid2=$person2->getXref(); // i2 => I2 } else { $pid2=''; } if (!empty($_SESSION["pid2"]) && $_SESSION["pid2"]!=$pid2) { unset($_SESSION["relationships"]); $path_to_find=0; } // -- print html header information $controller->setPageTitle($title_string); $controller->pageHeader(); if ($ENABLE_AUTOCOMPLETE) require WT_ROOT.'js/autocomplete.js.htm'; // Lbox additions if installed --------------------------------------------------------------------------------------------- if (WT_USE_LIGHTBOX) { require_once WT_ROOT.WT_MODULES_DIR.'lightbox/functions/lb_call_js.php'; } ?>


; margin:0;"> "; } else { if ($person1 && $person2) { $disp=$person1->canDisplayName() && $person2->canDisplayName(); if ($disp) { echo WT_I18N::translate('Show path'), ": "; echo ""; $prt = true; } } if (!isset($prt)) { echo " "; } } ?> "; if (($disp)&&(!$check_node)) { echo "'; } else { echo "'; } $pass = true; } if ($pass == false) echo ""; ?>
 
"; ?>
  />
$node) { if ($i==0) echo WT_I18N::translate('Show path').": "; if ($i>0) echo " | "; if ($i==$path_to_find) { echo "".($i+1).""; $new_path=false; } else { echo "".($i+1).""; } $i++; } if (($new_path)&&($path_to_find<$i+1)&&($check_node)) echo " | ".($i+1).""; echo ""; echo " "; $check_node = get_relationship($pid1, $pid2, $followspouse, 0, true, $path_to_find); echo $check_node ? "1" : " ".WT_I18N::translate('No results found.'), "  />
"; if (isset($_SESSION["relationships"])) { if ($path_to_find==0) { echo "", WT_I18N::translate('No link between the two individuals could be found.'), "
"; } else { echo "", WT_I18N::translate('No other link between the two individuals could be found.'), "
"; } } if (!$followspouse) { ?> "; } echo '
"; echo help_link('next_path'); echo '
 
', WT_I18N::translate('Click on any of the boxes to get more information about that person.'), '
'; } ?>
'; print_privacy_error(); echo '
'; } else { if (isset($_SESSION["relationships"][$path_to_find])) $node = $_SESSION["relationships"][$path_to_find]; else $node = get_relationship($pid1, $pid2, $followspouse, 0, true, $path_to_find); if ($node!==false) { $_SESSION["pid1"] = $pid1; $_SESSION["pid2"] = $pid2; if (!isset($_SESSION["relationships"])) $_SESSION["relationships"] = array(); $_SESSION["relationships"][$path_to_find] = $node; $yoffset = $Dbaseyoffset + 20; $xoffset = $Dbasexoffset; $colNum = 0; $rowNum = 0; $boxNum = 0; $previous=""; $previous2=""; $xs = $Dbxspacing+70; $ys = $Dbyspacing+50; // step1 = tree depth calculation $dmin=0; $dmax=0; $depth=0; foreach ($node["path"] as $index=>$pid) { if ($node["relations"][$index]=="father" || $node["relations"][$index]=="mother" || $node["relations"][$index]=="parent") { $depth++; if ($depth>$dmax) $dmax=$depth; if ($asc==0) $asc=1; // the first link is a parent link } if ($node["relations"][$index]=="son" || $node["relations"][$index]=="daughter" || $node["relations"][$index]=="child") { $depth--; if ($depth<$dmin) $dmin=$depth; if ($asc==0) $asc=-1; // the first link is a child link } } $depth=$dmax+$dmin; // need more yoffset before the first box ? if ($asc==1) $yoffset -= $dmin*($Dbheight+$ys); if ($asc==-1) $yoffset += $dmax*($Dbheight+$ys); $rowNum = ($asc==-1) ? $depth : 0; $maxxoffset = -1*$Dbwidth-20; $maxyoffset = $yoffset; if ($TEXT_DIRECTION=="ltr") { $rArrow = $WT_IMAGES["rarrow"]; $lArrow = $WT_IMAGES["larrow"]; } else { $rArrow = $WT_IMAGES["larrow"]; $lArrow = $WT_IMAGES["rarrow"]; } foreach ($node["path"] as $index=>$pid) { echo ""; $linex = $xoffset; $liney = $yoffset; $mfstyle = "NN"; $person=WT_Person::getInstance($pid); switch ($person->getSex()) { case 'M': $mfstyle=''; break; case 'F': $mfstyle='F'; break; case 'U': $mfstyle='NN'; break; } $arrow_img = $WT_IMAGES["darrow"]; if ($node["relations"][$index]=="father" || $node["relations"][$index]=="mother" || $node["relations"][$index]=="parent") { $line = $WT_IMAGES["vline"]; $liney += $Dbheight; $linex += $Dbwidth/2; $lh = 54; $lw = 3; //check for paternal grandparent relationship if ($asc==0) $asc=1; if ($asc==-1) $arrow_img = $WT_IMAGES["uarrow"]; $lh=$ys; $linex=$xoffset+$Dbwidth/2; // put the box up or down ? $yoffset += $asc*($Dbheight+$lh); $rowNum += $asc; if ($asc==1) $liney = $yoffset-$lh; else $liney = $yoffset+$Dbheight; // need to draw a joining line ? if ($previous=="child" and $previous2!="parent") { $joinh = 3; $joinw = $xs/2+2; $xoffset += $Dbwidth+$xs; $colNum ++; //$rowNum is inherited from the box immediately to the left $linex = $xoffset-$xs/2; if ($asc==-1) $liney=$yoffset+$Dbheight; else $liney=$yoffset-$lh; $joinx = $xoffset-$xs; $joiny = $liney-2-($asc-1)/2*$lh; echo "
\"\"
"; $joinw = $xs/2+2; $joinx = $joinx+$xs/2; $joiny = $joiny+$asc*$lh; echo "
\"\"
"; } $previous2=$previous; $previous="parent"; } if ($node["relations"][$index]=="brother" || $node["relations"][$index]=="sister" || $node["relations"][$index]=="sibling") { $arrow_img = $rArrow; $xoffset += $Dbwidth+$Dbxspacing+70; $colNum ++; //$rowNum is inherited from the box immediately to the left $line = $WT_IMAGES["hline"]; $linex += $Dbwidth; $liney += $Dbheight/2; $lh = 3; $lw = 70; $lw = $xs; $linex = $xoffset-$lw; $liney = $yoffset+$Dbheight/4; $previous2=$previous; $previous=""; } if ($node["relations"][$index]=="husband" || $node["relations"][$index]=="wife" || $node["relations"][$index]=="spouse") { $arrow_img = $rArrow; $xoffset += $Dbwidth+$Dbxspacing+70; $colNum ++; //$rowNum is inherited from the box immediately to the left $line = $WT_IMAGES["hline"]; $linex += $Dbwidth; $liney += $Dbheight/2; $lh = 3; $lw = 70; $lw = $xs; $linex = $xoffset-$lw; $liney = $yoffset+$Dbheight/4; $previous2=$previous; $previous=""; } if ($node["relations"][$index]=="son" || $node["relations"][$index]=="daughter" || $node["relations"][$index]=="child") { $line = $WT_IMAGES["vline"]; $liney += $Dbheight; $linex += $Dbwidth/2; $lh = 54; $lw = 3; if ($asc==0) $asc=-1; if ($asc==1) $arrow_img = $WT_IMAGES["uarrow"]; $lh=$ys; $linex = $xoffset+$Dbwidth/2; // put the box up or down ? $yoffset -= $asc*($Dbheight+$lh); $rowNum -= $asc; if ($asc==-1) $liney = $yoffset-$lh; else $liney = $yoffset+$Dbheight; // need to draw a joining line ? if ($previous=="parent" and $previous2!="child") { $joinh = 3; $joinw = $xs/2+2; $xoffset += $Dbwidth+$xs; $colNum ++; //$rowNum is inherited from the box immediately to the left $linex = $xoffset-$xs/2; if ($asc==1) $liney=$yoffset+$Dbheight; else $liney=$yoffset-($lh+$Dbyspacing); $joinx = $xoffset-$xs; $joiny = $liney-2+($asc+1)/2*$lh; echo "
\"\"
"; $joinw = $xs/2+2; $joinx = $joinx+$xs/2; $joiny = $joiny-$asc*$lh; echo "
\"\"
"; } $previous2=$previous; $previous="child"; } if ($yoffset > $maxyoffset) $maxyoffset = $yoffset; $plinex = $linex; $pxoffset = $xoffset; // Adjust all box positions for proper placement with respect to other page elements $pyoffset = $yoffset - 2; if ($index>0) { if ($TEXT_DIRECTION=="rtl" && $line!=$WT_IMAGES["hline"]) { echo "
"; echo "\"\""; echo "
"; echo WT_I18N::translate($node["relations"][$index]).""; echo "\"\""; } else { echo "
\"\""; echo "
"; echo "\"\""; if ($lh == 3) echo "
"; // note: $lh==3 means horiz arrow echo WT_I18N::translate($node["relations"][$index]).""; } echo "
"; } // Determine the z-index for this box $boxNum ++; $zIndex = 200 - ($colNum * $depth + $rowNum); echo "
"; print_pedigree_person(WT_Person::getInstance($pid), 1); echo "
"; } echo "
"; echo '

', WT_I18N::translate('Relationship: %s', get_relationship_name($node)), '

'; } } } $maxyoffset += 100; ?>