summaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
Diffstat (limited to 'library')
-rw-r--r--library/WT/Controller/Familybook.php26
-rw-r--r--library/WT/Controller/Hourglass.php42
2 files changed, 48 insertions, 20 deletions
diff --git a/library/WT/Controller/Familybook.php b/library/WT/Controller/Familybook.php
index e146c8fadd..e151421509 100644
--- a/library/WT/Controller/Familybook.php
+++ b/library/WT/Controller/Familybook.php
@@ -278,12 +278,15 @@ class WT_Controller_Familybook extends WT_Controller_Chart {
echo '</td>';
} else {
echo '<td>';
- for ($i=$count; $i<$genoffset-1; $i++) {
+ if ($count<$genoffset-1) {
echo '<table>';
- $this->printEmptyBox($bwidth, $bheight);
- echo '</tr>';
- $this->printEmptyBox($bwidth, $bheight);
- echo '</tr></table>';
+ for ($i=$count; $i<(pow(2, ($genoffset-1)-$count)/2)+2; $i++) {
+ $this->printEmptyBox($bwidth, $bheight);
+ echo '</tr>';
+ $this->printEmptyBox($bwidth, $bheight);
+ echo '</tr>';
+ }
+ echo '</table>';
}
}
echo '</tr><tr>',
@@ -300,12 +303,15 @@ class WT_Controller_Familybook extends WT_Controller_Chart {
echo '</td>';
} else {
echo '<td>';
- for ($i=$count; $i<$genoffset-1; $i++) {
+ if ($count<$genoffset-1) {
echo '<table>';
- $this->printEmptyBox($bwidth, $bheight);
- echo '</tr>';
- $this->printEmptyBox($bwidth, $bheight);
- echo '</tr></table>';
+ for ($i=$count; $i<(pow(2, ($genoffset-1)-$count)/2)+2; $i++) {
+ $this->printEmptyBox($bwidth, $bheight);
+ echo '</tr>';
+ $this->printEmptyBox($bwidth, $bheight);
+ echo '</tr>';
+ }
+ echo '</table>';
}
}
echo '</tr>',
diff --git a/library/WT/Controller/Hourglass.php b/library/WT/Controller/Hourglass.php
index 2c55b6ca49..7c2b6d2416 100644
--- a/library/WT/Controller/Hourglass.php
+++ b/library/WT/Controller/Hourglass.php
@@ -159,17 +159,29 @@ class WT_Controller_Hourglass extends WT_Controller_Chart {
//-- recursively get the father’s family
$this->print_person_pedigree($family->getHusband(), $count+1);
echo "</td>";
+ } else {
+ echo '<td>';
+ if ($count<$genoffset-1) {
+ echo '<table>';
+ for ($i=$count; $i<(pow(2, ($genoffset-1)-$count)/2)+2; $i++) {
+ $this->printEmptyBox($bwidth, $bheight);
+ echo '</tr>';
+ $this->printEmptyBox($bwidth, $bheight);
+ echo '</tr>';
+ }
+ echo '</table>';
+ }
}
- echo "</tr><tr>";
- echo "<td valign=\"top\"><img name=\"pvline\" src=\"".$WT_IMAGES["vline"]."\" width=\"3\" height=\"$lh\" alt=\"\"></td>";
- echo "<td><img class=\"line4\" src=\"".$WT_IMAGES["hline"]."\" width=\"7\" height=\"3\" alt=\"\"></td>";
- echo "<td>";
+ echo '</tr><tr>',
+ '<td valign="top"><img name="pvline" src="'.$WT_IMAGES["vline"].'" width="3" height="$lh" alt=""></td>',
+ '<td><img class="line4" src="'.$WT_IMAGES["hline"].'" width="7" height="3" alt=""></td>',
+ '<td>';
//-- print the mother box
print_pedigree_person($family->getWife());
- echo "</td>";
+ echo '</td>';
if ($family->getWife()) {
$ARID = $family->getWife()->getXref();
- echo "<td id=\"td_".$ARID."\">";
+ echo '<td id="td_'.$ARID.'">';
//-- print an ajax arrow on the last generation of the adult female
if ($count==$this->generations-1 && $family->getWife()->getChildFamilies()) {
@@ -178,14 +190,24 @@ class WT_Controller_Hourglass extends WT_Controller_Chart {
//-- recursively print the mother’s family
$this->print_person_pedigree($family->getWife(), $count+1);
- echo "</td>";
+ echo '</td>';
}
- echo "</tr>";
- echo "</table>";
+ echo '</tr>',
+ '</table>';
break;
}
}
-
+ /**
+ * Print empty box
+ */
+ function printEmptyBox($bwidth, $bheight){
+ echo '<tr>',
+ '<td>',
+ '<div style="width:',$bwidth+16,'px; height:',$bheight+8,'px;"></div>',
+ '</td>',
+ '<td>';
+ }
+
/**
* Prints descendency of passed in person
*