pageHeader()
->addInlineJavaScript('var pastefield; function paste_id(value) { pastefield.value=value; }'); // For the "find indi" link
if ($ENABLE_AUTOCOMPLETE) {
require WT_ROOT.'js/autocomplete.js.htm';
}
if (WT_USE_LIGHTBOX) {
require WT_ROOT.WT_MODULES_DIR.'lightbox/functions/lb_call_js.php';
}
?>
treesize-1); $i>=0; $i--) {
// -- check to see if we have moved to the next generation
if ($i < floor($controller->treesize / (pow(2, $curgen)))) {
$curgen++;
}
$prevxoffset = $xoffset;
$prevyoffset = $yoffset;
if ($talloffset < 2) { // Portrate 0 Landscape 1 top 2 bottom 3
$xoffset = $controller->offsetarray[$i]["x"];
$yoffset = $controller->offsetarray[$i]["y"];
} else {
$xoffset = $controller->offsetarray[$i]["y"];
$yoffset = $controller->offsetarray[$i]["x"];
}
// -- if we are in the middle generations then we need to draw the connecting lines
if (($curgen > 0 && $talloffset > 1) || (($curgen > $talloffset) && ($curgen < $controller->PEDIGREE_GENERATIONS))) {
if ($i%2==1) {
if ($SHOW_EMPTY_BOXES || ($controller->treeid[$i]) || ($controller->treeid[$i+1])) {
if ($talloffset < 2) {
$vlength = $prevyoffset-$yoffset;
$lastvlength = $vlength;
// If no father then adjust lines
if (!$controller->treeid[$i] && (!$SHOW_EMPTY_BOXES)) {
$vlength = ($lastvlength/2);
if ($talloffset == 0 && $show_full==1) $yoffset = $yoffset+$controller->pbheight+50;
if ($talloffset == 0 && $show_full==0) $yoffset = $yoffset+$controller->pbheight+30;
if ($talloffset == 1) $yoffset = $yoffset+$controller->pbheight+5;
}
}
else {
$vlength = $prevxoffset-$xoffset;
}
if (!$SHOW_EMPTY_BOXES && (empty($controller->treeid[$i+1]))) {
$parent = ceil(($i-1)/2);
$vlength = $controller->offsetarray[$parent]["y"]-$yoffset;
}
$linexoffset = $xoffset;
if ($talloffset < 2) {
echo '
'; // vertical line joining boxes
echo '

'; // vertical line joining boxes
echo '
';
} else {
echo '
';
echo '

';
} else {
echo ($linexoffset-1+$controller->pbwidth/2+$vlength/2), 'px; top:', ($yoffset+1+$controller->pbheight/2+10), 'px; z-index: 0;">';
echo '

';
}
echo '
';
echo '
';
echo '

';
echo '
';
}
} else { // here if no parents and no empty boxes
$vlength = $prevxoffset-$xoffset;
$linexoffset = $xoffset;
}
}
}
// -- draw the box
if (!empty($controller->treeid[$i]) || $SHOW_EMPTY_BOXES) {
// Work around a bug in FireFox that mis-places some boxes in Portrait RTL, resulting in
// vertical lines that themselves appear to be mis-placed.
if ($TEXT_DIRECTION=="rtl") {
$xoffset += $brborder; // Account for thickness of right box border
}
if ($yoffset>$maxyoffset) {
$maxyoffset=$yoffset;
}
$widthadd = 0;
if ($i==0) {
$iref = rand();
} else {
$iref = $i;
}
// Can we go back to an earlier generation?
$can_go_back=$curgen==1 && WT_Person::getInstance($controller->treeid[$i]) && WT_Person::getInstance($controller->treeid[$i])->getChildFamilies();
if ($can_go_back) {
$widthadd = 20;
} elseif ($curgen >2 && $curgen < $controller->PEDIGREE_GENERATIONS) {
$widthadd = 10;
}
if ($talloffset == 2) {
echo '
";
}
// beginning of box setup and display
echo "
treeid[$i])) {
echo "$iref";
} else {
echo $controller->treeid[$i];
}
if ($TEXT_DIRECTION=="rtl") {
echo ".1.$iref\" style=\"position:absolute; right:";
} else {
echo ".1.$iref\" style=\"position:absolute; left:";
}
if ($talloffset == 2) {
$zindex = $PEDIGREE_GENERATIONS-$curgen;
} else {
$zindex = 0;
}
//Correct box spacing for Oldest on bottom
if (($talloffset == 3) && ($curgen ==1)) {
$yoffset +=25;
}
if (($talloffset == 3) && ($curgen ==2)) {
$yoffset +=10;
}
echo $xoffset, "px; top:", ($yoffset-1), "px; width:", ($controller->pbwidth+$widthadd), "px; height:", $controller->pbheight, "px; ";
echo "z-index: ", $zindex, ";\">";
echo "
";
}
}
// -- echo left arrow for decendants so that we can move down the tree
$yoffset += ($controller->pbheight / 2)-10;
$famids = $controller->root->getSpouseFamilies();
//-- make sure there is more than 1 child in the family with parents
$cfamids = $controller->root->getChildFamilies();
if (count($famids)>0) {
echo "
";
$yoffset += ($controller->pbheight / 2)+10;
echo "
pbwidth, "px; height:", $controller->pbheight, "px; visibility: hidden;\">";
echo "
";
echo "
";
}
// -- print html footer
$maxyoffset+=30;
?>