コード例 #1
0
ファイル: Descendancy.php プロジェクト: brambravo/webtrees
 /**
  * print a family descendancy
  *
  * @param WT_Individual $person
  * @param WT_Family     $family
  * @param int           $depth the descendancy depth to show
  *
  * @return void
  */
 function print_family_descendancy(WT_Individual $person, WT_Family $family, $depth)
 {
     global $WT_IMAGES, $Dindent, $personcount;
     // print marriage info
     echo '<li>';
     echo '<img src="', $WT_IMAGES['spacer'], '" height="2" width="', $Dindent + 4, '" alt="">';
     echo '<span class="details1" style="white-space:nowrap;">';
     echo "<a href=\"#\" onclick=\"expand_layer('" . $family->getXref() . $personcount . "'); return false;\" class=\"top\"><i id=\"" . $family->getXref() . $personcount . "_img\" class=\"icon-minus\" title=\"" . WT_I18N::translate('View family') . "\"></i></a>";
     if ($family->canShow()) {
         foreach ($family->getFacts(WT_EVENTS_MARR) as $fact) {
             echo ' <a href="', $family->getHtmlUrl(), '" class="details1">', $fact->summary(), '</a>';
         }
     }
     echo '</span>';
     // print spouse
     $spouse = $family->getSpouse($person);
     echo '<ul style="list-style:none; display:block;" id="' . $family->getXref() . $personcount . '">';
     echo '<li>';
     echo '<table border="0" cellpadding="0" cellspacing="0"><tr><td>';
     print_pedigree_person($spouse, 1, 0, $personcount);
     echo '</td>';
     // check if spouse has parents and add an arrow
     echo '<td>&nbsp;</td>';
     echo '<td>';
     if ($spouse) {
         foreach ($spouse->getChildFamilies() as $cfamily) {
             foreach ($cfamily->getSpouses() as $parent) {
                 print_url_arrow($parent->getXref() . $personcount . $person->getXref(), '?rootid=' . $parent->getXref() . '&amp;generations=' . $this->generations . '&amp;chart_style=' . $this->chart_style . '&amp;show_full=' . $this->show_full . '&amp;box_width=' . $this->box_width . '&amp;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 '<br><br>&nbsp;';
     }
     echo '</td></tr>';
     // children
     $children = $family->getChildren();
     echo '<tr><td colspan="3" class="details1" >&nbsp;&nbsp;';
     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 '</td></tr></table>';
     echo '</li>';
     if ($depth > 1) {
         foreach ($children as $child) {
             $personcount++;
             $this->print_child_descendancy($child, $depth - 1);
         }
     }
     echo '</ul>';
     echo '</li>';
 }
コード例 #2
0
/**
 * print the parents table for a family
 *
 * @param WT_Family $family family gedcom ID
 * @param int       $sosa   child sosa number
 * @param string    $label  indi label (descendancy booklet)
 * @param string    $parid  parent ID (descendancy booklet)
 * @param string    $gparid gd-parent ID (descendancy booklet)
 * @param int       $personcount
 */
function print_family_parents(WT_Family $family, $sosa = 0, $label = '', $parid = '', $gparid = '', $personcount = 1)
{
    global $pbwidth, $pbheight, $WT_IMAGES;
    $husb = $family->getHusband();
    if ($husb) {
        echo '<a name="', $husb->getXref(), '"></a>';
    } else {
        $husb = new WT_Individual('M', "0 @M@ INDI\n1 SEX M", null, WT_GED_ID);
    }
    $wife = $family->getWife();
    if ($wife) {
        echo '<a name="', $wife->getXref(), '"></a>';
    } else {
        $wife = new WT_Individual('F', "0 @F@ INDI\n1 SEX F", null, WT_GED_ID);
    }
    if ($sosa) {
        echo '<p class="name_head">', $family->getFullName(), '</p>';
    }
    /**
     * husband side
     */
    echo "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td rowspan=\"2\">";
    echo "<table style=\"width: " . $pbwidth . "px; height: " . $pbheight . "px;\" border=\"0\"><tr>";
    if ($parid) {
        if ($husb->getXref() == $parid) {
            print_sosa_number($label);
        } else {
            print_sosa_number($label, "", "blank");
        }
    } elseif ($sosa) {
        print_sosa_number($sosa * 2);
    }
    if ($husb->isNew()) {
        echo '<td valign="top" class="facts_value new">';
    } elseif ($husb->isOld()) {
        echo '<td valign="top" class="facts_value old">';
    } else {
        echo '<td valign="top">';
    }
    print_pedigree_person($husb, 1, 2, $personcount);
    echo "</td></tr></table>";
    echo "</td>";
    // husband’s parents
    $hfam = $husb->getPrimaryChildFamily();
    if ($hfam) {
        // remove the|| test for $sosa
        echo "<td rowspan=\"2\"><img src=\"" . $WT_IMAGES["hline"] . "\" alt=\"\"></td><td rowspan=\"2\"><img src=\"" . $WT_IMAGES["vline"] . "\" width=\"3\" height=\"" . ($pbheight + 9) . "\" alt=\"\"></td>";
        echo "<td><img class=\"line5\" src=\"" . $WT_IMAGES["hline"] . "\" alt=\"\"></td><td>";
        // husband’s father
        if ($hfam && $hfam->getHusband()) {
            echo "<table style=\"width: " . $pbwidth . "px; height: " . $pbheight . "px;\" border=\"0\"><tr>";
            if ($sosa > 0) {
                print_sosa_number($sosa * 4, $hfam->getHusband()->getXref(), "down");
            }
            if (!empty($gparid) && $hfam->getHusband()->getXref() == $gparid) {
                print_sosa_number(trim(substr($label, 0, -3), ".") . ".");
            }
            echo "<td valign=\"top\">";
            print_pedigree_person(WT_Individual::getInstance($hfam->getHusband()->getXref()), 1, 4, $personcount);
            echo "</td></tr></table>";
        } elseif ($hfam && !$hfam->getHusband()) {
            // here for empty box for grandfather
            echo "<table style=\"width: " . $pbwidth . "px; height: " . $pbheight . "px;\" border=\"0\"><tr>";
            echo '<td valign="top">';
            print_pedigree_person($hfam->getHusband());
            echo '</td></tr></table>';
        }
        echo "</td>";
    }
    if ($hfam && $sosa != -1) {
        echo '<td valign="middle" rowspan="2">';
        print_url_arrow($hfam->getXref(), $sosa == 0 ? '?famid=' . $hfam->getXref() . '&amp;ged=' . WT_GEDURL : '#' . $hfam->getXref(), $hfam->getXref(), 1);
        echo '</td>';
    }
    if ($hfam) {
        // remove the|| test for $sosa
        // husband’s mother
        echo "</tr><tr><td><img src=\"" . $WT_IMAGES["hline"] . "\" alt=\"\"></td><td>";
        if ($hfam && $hfam->getWife()) {
            echo "<table style=\"width: " . $pbwidth . "px; height: " . $pbheight . "px;\" border=\"0\"><tr>";
            if ($sosa > 0) {
                print_sosa_number($sosa * 4 + 1, $hfam->getWife()->getXref(), "down");
            }
            if (!empty($gparid) && $hfam->getWife()->getXref() == $gparid) {
                print_sosa_number(trim(substr($label, 0, -3), ".") . ".");
            }
            echo '<td valign="top">';
            print_pedigree_person(WT_Individual::getInstance($hfam->getWife()->getXref()), 1, 5, $personcount);
            echo '</td></tr></table>';
        } elseif ($hfam && !$hfam->getWife()) {
            // here for empty box for grandmother
            echo "<table style=\"width: " . $pbwidth . "px; height: " . $pbheight . "px;\" border=\"0\"><tr>";
            echo '<td valign="top">';
            print_pedigree_person($hfam->getWife());
            echo '</td></tr></table>';
        }
        echo '</td>';
    }
    echo '</tr></table>';
    if ($sosa && $family->canShow()) {
        foreach ($family->getFacts(WT_EVENTS_MARR) as $fact) {
            echo '<a href="', $family->getHtmlUrl(), '" class="details1">';
            echo str_repeat('&nbsp;', 10);
            echo $fact->summary();
            echo '</a>';
        }
    } else {
        echo '<br>';
    }
    /**
     * wife side
     */
    echo "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td rowspan=\"2\">";
    echo "<table style=\"width: " . $pbwidth . "px; height: " . $pbheight . "px;\"><tr>";
    if ($parid) {
        if ($wife->getXref() == $parid) {
            print_sosa_number($label);
        } else {
            print_sosa_number($label, "", "blank");
        }
    } elseif ($sosa) {
        print_sosa_number($sosa * 2 + 1);
    }
    if ($wife->isNew()) {
        echo '<td valign="top" class="facts_value new">';
    } elseif ($wife->isOld()) {
        echo '<td valign="top" class="facts_value old">';
    } else {
        echo '<td valign="top">';
    }
    print_pedigree_person($wife, 1, 3, $personcount);
    echo "</td></tr></table>";
    echo "</td>";
    // wife’s parents
    $hfam = $wife->getPrimaryChildFamily();
    if ($hfam) {
        // remove the|| test for $sosa
        echo "<td rowspan=\"2\"><img src=\"" . $WT_IMAGES["hline"] . "\" alt=\"\"></td><td rowspan=\"2\"><img src=\"" . $WT_IMAGES["vline"] . "\" width=\"3\" height=\"" . ($pbheight + 9) . "\" alt=\"\"></td>";
        echo "<td><img class=\"line5\" src=\"" . $WT_IMAGES["hline"] . "\" alt=\"\"></td><td>";
        // wife’s father
        if ($hfam && $hfam->getHusband()) {
            echo "<table style=\"width: " . $pbwidth . "px; height: " . $pbheight . "px;\"><tr>";
            if ($sosa > 0) {
                print_sosa_number($sosa * 4 + 2, $hfam->getHusband()->getXref(), "down");
            }
            if (!empty($gparid) && $hfam->getHusband()->getXref() == $gparid) {
                print_sosa_number(trim(substr($label, 0, -3), ".") . ".");
            }
            echo "<td valign=\"top\">";
            print_pedigree_person(WT_Individual::getInstance($hfam->getHusband()->getXref()), 1, 6, $personcount);
            echo "</td></tr></table>";
        } elseif ($hfam && !$hfam->getHusband()) {
            // here for empty box for grandfather
            echo "<table style=\"width: " . $pbwidth . "px; height: " . $pbheight . "px;\" border=\"0\"><tr>";
            echo '<td valign="top">';
            print_pedigree_person($hfam->getHusband());
            echo '</td></tr></table>';
        }
        echo "</td>";
    }
    if ($hfam && $sosa != -1) {
        echo '<td valign="middle" rowspan="2">';
        print_url_arrow($hfam->getXref(), $sosa == 0 ? '?famid=' . $hfam->getXref() . '&amp;ged=' . WT_GEDURL : '#' . $hfam->getXref(), $hfam->getXref(), 1);
        echo '</td>';
    }
    if ($hfam) {
        // remove the|| test for $sosa
        // wife’s mother
        echo "</tr><tr><td><img src=\"" . $WT_IMAGES["hline"] . "\" alt=\"\"></td><td>";
        if ($hfam && $hfam->getWife()) {
            echo "<table style=\"width: " . $pbwidth . "px; height: " . $pbheight . "px;\"><tr>";
            if ($sosa > 0) {
                print_sosa_number($sosa * 4 + 3, $hfam->getWife()->getXref(), "down");
            }
            if (!empty($gparid) && $hfam->getWife()->getXref() == $gparid) {
                print_sosa_number(trim(substr($label, 0, -3), ".") . ".");
            }
            echo "<td valign=\"top\">";
            print_pedigree_person(WT_Individual::getInstance($hfam->getWife()->getXref()), 1, 7, $personcount);
            echo "</td></tr></table>";
        } elseif ($hfam && !$hfam->getWife()) {
            // here for empty box for grandmother
            echo "<table style=\"width: " . $pbwidth . "px; height: " . $pbheight . "px;\" border=\"0\"><tr>";
            echo '<td valign="top">';
            print_pedigree_person($hfam->getWife());
            echo '</td></tr></table>';
        }
        echo '</td>';
    }
    echo "</tr></table>";
}
コード例 #3
0
/**
 * print the parents table for a family
 *
 * @param string $famid family gedcom ID
 * @param int $sosa optional child sosa number
 * @param string $label optional indi label (descendancy booklet)
 * @param string $parid optional parent ID (descendancy booklet)
 * @param string $gparid optional gd-parent ID (descendancy booklet)
 */
function print_family_parents($famid, $sosa = 0, $label = "", $parid = "", $gparid = "", $personcount = "1")
{
    global $pgv_lang, $view, $show_full, $show_famlink;
    global $TEXT_DIRECTION, $SHOW_EMPTY_BOXES, $SHOW_ID_NUMBERS, $LANGUAGE;
    global $pbwidth, $pbheight;
    global $PGV_IMAGE_DIR, $PGV_IMAGES;
    global $show_changes, $pgv_changes, $GEDCOM;
    $family = Family::getInstance($famid);
    if (is_null($family)) {
        return;
    }
    $husb = $family->getHusband();
    if (is_null($husb)) {
        $husb = new Person('');
    }
    $wife = $family->getWife();
    if (is_null($wife)) {
        $wife = new Person('');
    }
    if (!is_null($husb)) {
        $tempID = $husb->getXref();
        if (!empty($tempID)) {
            print "<a name=\"{$tempID}\"></a>\r\n";
        }
    }
    if (!is_null($wife)) {
        $tempID = $wife->getXref();
        if (!empty($tempID)) {
            print "<a name=\"{$tempID}\"></a>\r\n";
        }
    }
    print_family_header($famid);
    // -- get the new record and parents if in editing show changes mode
    if (PGV_USER_CAN_EDIT && isset($pgv_changes[$famid . "_" . $GEDCOM])) {
        $newrec = find_updated_record($famid);
        $newparents = find_parents_in_record($newrec);
    }
    /**
     * husband side
     */
    print "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td rowspan=\"2\">";
    print "<span class=\"subheaders\">" . get_sosa_name($sosa * 2) . "</span>";
    print "\n\t<table style=\"width: " . $pbwidth . "px; height: " . $pbheight . "px;\" border=\"0\"><tr>";
    if ($parid) {
        if ($husb->getXref() == $parid) {
            print_sosa_number($label);
        } else {
            print_sosa_number($label, "", "blank");
        }
    } else {
        if ($sosa > 0) {
            print_sosa_number($sosa * 2);
        }
    }
    if (isset($newparents) && $husb->getXref() != $newparents["HUSB"]) {
        print "\n\t<td valign=\"top\" class=\"facts_valueblue\">";
        print_pedigree_person($newparents['HUSB'], 1, $show_famlink, 2, $personcount);
    } else {
        print "\n\t<td valign=\"top\">";
        print_pedigree_person($husb->getXref(), 1, $show_famlink, 2, $personcount);
    }
    print "</td></tr></table>";
    print "</td>\n";
    // husband's parents
    $hfams = $husb->getChildFamilies();
    $hparents = false;
    $upfamid = "";
    if (count($hfams) > 0 or $sosa != 0 and $SHOW_EMPTY_BOXES) {
        print "<td rowspan=\"2\"><img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["hline"]["other"] . "\" alt=\"\" /></td><td rowspan=\"2\"><img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["vline"]["other"] . "\" width=\"3\" height=\"" . $pbheight . "\" alt=\"\" /></td>";
        print "<td><img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["hline"]["other"] . "\" alt=\"\" /></td><td>";
        $hparents = false;
        foreach ($hfams as $hfamid => $hfamily) {
            if (!is_null($hfamily)) {
                $hparents = find_parents_in_record($hfamily->getGedcomRecord());
                $upfamid = $hfamid;
                break;
            }
        }
        if ($hparents or $sosa != 0 and $SHOW_EMPTY_BOXES) {
            // husband's father
            print "\n\t<table style=\"width: " . $pbwidth . "px; height: " . $pbheight . "px;\" border=\"0\"><tr>";
            if ($sosa > 0) {
                print_sosa_number($sosa * 4, $hparents['HUSB'], "down");
            }
            if (!empty($gparid) and $hparents['HUSB'] == $gparid) {
                print_sosa_number(trim(substr($label, 0, -3), ".") . ".");
            }
            print "\n\t<td valign=\"top\">";
            print_pedigree_person($hparents['HUSB'], 1, $show_famlink, 4, $personcount);
            print "</td></tr></table>";
        }
        print "</td>";
    }
    if (!empty($upfamid) and $sosa != -1 and $view != "preview") {
        print "<td valign=\"middle\" rowspan=\"2\">";
        print_url_arrow($upfamid, $sosa == 0 ? "?famid={$upfamid}&amp;show_full={$show_full}" : "#{$upfamid}", "{$upfamid}", 1);
        print "</td>\n";
    }
    if ($hparents or $sosa != 0 and $SHOW_EMPTY_BOXES) {
        // husband's mother
        print "</tr><tr><td><img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["hline"]["other"] . "\" alt=\"\" /></td><td>";
        print "\n\t<table style=\"width: " . $pbwidth . "px; height: " . $pbheight . "px;\" border=\"0\"><tr>";
        if ($sosa > 0) {
            print_sosa_number($sosa * 4 + 1, $hparents['WIFE'], "down");
        }
        if (!empty($gparid) and $hparents['WIFE'] == $gparid) {
            print_sosa_number(trim(substr($label, 0, -3), ".") . ".");
        }
        print "\n\t<td valign=\"top\">";
        print_pedigree_person($hparents['WIFE'], 1, $show_famlink, 5, $personcount);
        print "</td></tr></table>";
        print "</td>\n";
    }
    print "</tr></table>\n\n";
    if ($sosa != 0) {
        print "<a href=\"family.php?famid={$famid}\" class=\"details1\">";
        if ($SHOW_ID_NUMBERS) {
            print getLRM() . "({$famid})" . getLRM() . "&nbsp;&nbsp;";
        } else {
            print str_repeat("&nbsp;", 10);
        }
        $marriage = $family->getMarriage();
        if ($marriage->canShow()) {
            $marriage->print_simple_fact();
        } else {
            print $pgv_lang["private"];
        }
        print "</a>";
    } else {
        print "<br />\n";
    }
    /**
     * wife side
     */
    print "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td rowspan=\"2\">";
    print "<span class=\"subheaders\">" . get_sosa_name($sosa * 2 + 1) . "</span>";
    print "\n\t<table style=\"width: " . $pbwidth . "px; height: " . $pbheight . "px;\"><tr>";
    if ($parid) {
        if ($wife->getXref() == $parid) {
            print_sosa_number($label);
        } else {
            print_sosa_number($label, "", "blank");
        }
    } else {
        if ($sosa > 0) {
            print_sosa_number($sosa * 2 + 1);
        }
    }
    if (isset($newparents) && $wife->getXref() != $newparents["WIFE"]) {
        print "\n\t<td valign=\"top\" class=\"facts_valueblue\">";
        print_pedigree_person($newparents['WIFE'], 1, $show_famlink, 3, $personcount);
    } else {
        print "\n\t<td valign=\"top\">";
        print_pedigree_person($wife->getXref(), 1, $show_famlink, 3, $personcount);
    }
    print "</td></tr></table>";
    print "</td>\n";
    // wife's parents
    $hfams = $wife->getChildFamilies();
    $hparents = false;
    $upfamid = "";
    if (count($hfams) > 0 or $sosa != 0 and $SHOW_EMPTY_BOXES) {
        print "<td rowspan=\"2\"><img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["hline"]["other"] . "\" alt=\"\" /></td><td rowspan=\"2\"><img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["vline"]["other"] . "\" width=\"3\" height=\"" . $pbheight . "\" alt=\"\" /></td>";
        print "<td><img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["hline"]["other"] . "\" alt=\"\" /></td><td>";
        $j = 0;
        foreach ($hfams as $hfamid => $hfamily) {
            if (!is_null($hfamily)) {
                $hparents = find_parents_in_record($hfamily->getGedcomRecord());
                $upfamid = $hfamid;
                break;
            }
        }
        if ($hparents or $sosa != 0 and $SHOW_EMPTY_BOXES) {
            // wife's father
            print "\n\t<table style=\"width: " . $pbwidth . "px; height: " . $pbheight . "px;\"><tr>";
            if ($sosa > 0) {
                print_sosa_number($sosa * 4 + 2, $hparents['HUSB'], "down");
            }
            if (!empty($gparid) and $hparents['HUSB'] == $gparid) {
                print_sosa_number(trim(substr($label, 0, -3), ".") . ".");
            }
            print "\n\t<td valign=\"top\">";
            print_pedigree_person($hparents['HUSB'], 1, $show_famlink, 6, $personcount);
            print "</td></tr></table>";
        }
        print "</td>\n";
    }
    if (!empty($upfamid) and $sosa != -1 and $view != "preview") {
        print "<td valign=\"middle\" rowspan=\"2\">";
        print_url_arrow($upfamid, $sosa == 0 ? "?famid={$upfamid}&amp;show_full={$show_full}" : "#{$upfamid}", "{$upfamid}", 1);
        print "</td>\n";
    }
    if ($hparents or $sosa != 0 and $SHOW_EMPTY_BOXES) {
        // wife's mother
        print "</tr><tr><td><img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["hline"]["other"] . "\" alt=\"\" /></td><td>";
        print "\n\t<table style=\"width: " . $pbwidth . "px; height: " . $pbheight . "px;\"><tr>";
        if ($sosa > 0) {
            print_sosa_number($sosa * 4 + 3, $hparents['WIFE'], "down");
        }
        if (!empty($gparid) and $hparents['WIFE'] == $gparid) {
            print_sosa_number(trim(substr($label, 0, -3), ".") . ".");
        }
        print "\n\t<td valign=\"top\">";
        print_pedigree_person($hparents['WIFE'], 1, $show_famlink, 7, $personcount);
        print "</td></tr></table>\n";
        print "</td>\n";
    }
    print "</tr></table>\n\n";
}
コード例 #4
0
 /**
  * print a child ascendancy
  *
  * @param string $pid individual Gedcom Id
  * @param int $sosa child sosa number
  * @param int $depth the ascendancy depth to show
  */
 function print_child_ascendancy($pid, $sosa, $depth)
 {
     global $pgv_lang, $TEXT_DIRECTION, $OLD_PGENS;
     global $PGV_IMAGE_DIR, $PGV_IMAGES, $Dindent;
     global $SHOW_EMPTY_BOXES, $pidarr, $box_width;
     $person = Person::getInstance($pid);
     // child
     print "\r\n<li>";
     print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><a name=\"sosa" . $sosa . "\"></a>";
     $new = ($pid == "" or !isset($pidarr["{$pid}"]));
     if ($sosa == 1) {
         print "<img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["spacer"]["other"] . "\" height=\"3\" width=\"{$Dindent}\" border=\"0\" alt=\"\" /></td><td>\n";
     } else {
         print "<img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["spacer"]["other"] . "\" height=\"3\" width=\"2\" border=\"0\" alt=\"\" />";
         print "<img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["hline"]["other"] . "\" height=\"3\" width=\"" . ($Dindent - 2) . "\" border=\"0\" alt=\"\" /></td><td>\n";
     }
     print_pedigree_person($pid, 1, $this->view != "preview");
     print "</td>";
     print "<td>";
     if ($TEXT_DIRECTION == "ltr") {
         $label = $pgv_lang["ancestry_chart"] . ": " . $pid;
     } else {
         $label = $pid . " :" . $pgv_lang["ancestry_chart"];
     }
     if ($sosa > 1) {
         print_url_arrow($pid, encode_url("?rootid={$pid}&PEDIGREE_GENERATIONS={$OLD_PGENS}&show_full={$this->show_full}&box_width={$box_width}&chart_style={$this->chart_style}"), $label, 3);
     }
     print "</td>";
     print "<td class=\"details1\">&nbsp;<span dir=\"ltr\" class=\"person_box" . ($sosa == 1 ? "NN" : ($sosa % 2 ? "F" : "")) . "\">&nbsp;{$sosa}&nbsp;</span>&nbsp;";
     print "</td><td class=\"details1\">";
     $relation = "";
     if (!$new) {
         $relation = "<br />[=<a href=\"#sosa" . $pidarr["{$pid}"] . "\">" . $pidarr["{$pid}"] . "</a> - " . get_sosa_name($pidarr["{$pid}"]) . "]";
     } else {
         $pidarr["{$pid}"] = $sosa;
     }
     print get_sosa_name($sosa) . $relation;
     print "</td>";
     print "</tr></table>";
     if (is_null($person)) {
         print "</li>";
         return;
     }
     // parents
     $famids = $person->getChildFamilies();
     $parents = false;
     $famrec = "";
     $famid = "";
     foreach ($famids as $famid => $family) {
         if (!is_null($family)) {
             $famrec = $family->getGedcomRecord();
             $parents = find_parents_in_record($famrec);
             if ($parents) {
                 break;
             }
         }
     }
     if (($parents || $SHOW_EMPTY_BOXES) && $new && $depth > 0) {
         // print marriage info
         print "<span class=\"details1\" style=\"white-space: nowrap;\" >";
         print "<img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["spacer"]["other"] . "\" height=\"2\" width=\"{$Dindent}\" border=\"0\" align=\"middle\" alt=\"\" /><a href=\"javascript: " . $pgv_lang["view_family"] . "\" onclick=\"expand_layer('sosa_" . $sosa . "'); return false;\" class=\"top\"><img id=\"sosa_" . $sosa . "_img\" src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["minus"]["other"] . "\" align=\"middle\" hspace=\"0\" vspace=\"3\" border=\"0\" alt=\"" . $pgv_lang["view_family"] . "\" /></a> ";
         print "&nbsp;<span class=\"person_box\">&nbsp;" . $sosa * 2 . "&nbsp;</span>&nbsp;" . $pgv_lang["and"];
         print "&nbsp;<span class=\"person_boxF\">&nbsp;" . ($sosa * 2 + 1) . " </span>&nbsp;";
         if (!empty($family)) {
             $marriage = $family->getMarriage();
             if ($marriage->canShow()) {
                 $marriage->print_simple_fact();
             } else {
                 print $pgv_lang["private"];
             }
         }
         print "</span>";
         // display parents recursively
         print "\r\n<ul style=\"list-style: none; display: block;\" id=\"sosa_{$sosa}\">";
         $this->print_child_ascendancy($parents["HUSB"], $sosa * 2, $depth - 1);
         $this->print_child_ascendancy($parents["WIFE"], $sosa * 2 + 1, $depth - 1);
         print "</ul>\r\n";
     }
     print "</li>\r\n";
 }
コード例 #5
0
 /**
  * print a family descendancy
  *
  * @param string $pid individual Gedcom Id
  * @param Family $famid family record
  * @param int $depth the descendancy depth to show
  */
 function print_family_descendancy(&$person, &$family, $depth)
 {
     global $pgv_lang, $factarray;
     global $GEDCOM, $PGV_IMAGE_DIR, $PGV_IMAGES, $Dindent, $personcount;
     if (is_null($family)) {
         return;
     }
     if (is_null($person)) {
         return;
     }
     $famrec = $family->getGedcomRecord();
     $famid = $family->getXref();
     $parents = find_parents($famid);
     if ($parents) {
         // spouse id
         $id = $parents["WIFE"];
         if ($id == $person->getXref()) {
             $id = $parents["HUSB"];
         }
         // print marriage info
         print "<li>";
         print "<img src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["spacer"]["other"] . "\" height=\"2\" width=\"" . ($Dindent + 4) . "\" border=\"0\" alt=\"\" />";
         print "<span class=\"details1\" style=\"white-space: nowrap; \" >";
         print "<a href=\"#\" onclick=\"expand_layer('" . $famid . $personcount . "'); return false;\" class=\"top\"><img id=\"" . $famid . $personcount . "_img\" src=\"" . $PGV_IMAGE_DIR . "/" . $PGV_IMAGES["minus"]["other"] . "\" align=\"middle\" hspace=\"0\" vspace=\"3\" border=\"0\" alt=\"" . $pgv_lang["view_family"] . "\" /></a> ";
         echo '<a href="', encode_url("family.php?famid={$famid}&ged={$GEDCOM}"), '" class="details1">';
         $marriage = $family->getMarriage();
         if ($marriage->canShow()) {
             $marriage->print_simple_fact();
         } else {
             print $pgv_lang["private"];
         }
         echo "</a>";
         print "</span>";
         // print spouse
         print "<ul style=\"list-style: none; display: block;\" id=\"" . $famid . $personcount . "\">";
         print "<li>";
         print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td>";
         print_pedigree_person($id, 1, $this->view != "preview", '' . $personcount);
         print "</td>";
         // check if spouse has parents and add an arrow
         print "<td>&nbsp;</td>";
         print "<td>";
         $sfamids = find_family_ids($id);
         foreach ($sfamids as $indexval => $sfamid) {
             $parents = find_parents($sfamid);
             if ($parents) {
                 $parid = $parents["HUSB"];
                 if ($parid == "") {
                     $parid = $parents["WIFE"];
                 }
                 if ($parid != "") {
                     print_url_arrow($parid . $personcount . $person->getXref(), encode_url("?pid={$parid}&generations={$this->generations}&show_full={$this->show_full}&box_width={$this->box_width}"), $pgv_lang["start_at_parents"], 2);
                     $personcount++;
                 }
             }
         }
         if ($this->show_full) {
             print "<br /><br />&nbsp;";
         }
         print "</td></tr>";
         // children
         $children = $family->getChildren();
         print "<tr><td colspan=\"3\" class=\"details1\" >&nbsp;&nbsp;";
         if (count($children) < 1) {
             print $pgv_lang["no_children"];
         } else {
             print $factarray["NCHI"] . ": " . count($children);
         }
         print "</td></tr></table>";
         print "</li>\r\n";
         if ($depth > 0) {
             foreach ($children as $child) {
                 $personcount++;
                 $this->print_child_descendancy($child, $depth - 1);
             }
         }
         print "</ul>\r\n";
         print "</li>\r\n";
     }
 }
コード例 #6
0
ファイル: Ancestry.php プロジェクト: brambravo/webtrees
 /**
  * print a child ascendancy
  *
  * @param     $person
  * @param int $sosa  child sosa number
  * @param int $depth the ascendancy depth to show
  */
 function print_child_ascendancy($person, $sosa, $depth)
 {
     global $OLD_PGENS, $WT_IMAGES, $Dindent, $pidarr, $box_width;
     if ($person) {
         $pid = $person->getXref();
         $label = WT_I18N::translate('Ancestors of %s', $person->getFullName());
     } else {
         $pid = '';
         $label = '';
     }
     // child
     echo '<li>';
     echo '<table border="0" cellpadding="0" cellspacing="0"><tr><td><a name="sosa', $sosa, '"></a>';
     if ($sosa == 1) {
         echo '<img src="', $WT_IMAGES['spacer'], '" height="3" width="', $Dindent, '" alt=""></td><td>';
     } else {
         echo '<img src="', $WT_IMAGES['spacer'], '" height="3" width="2" alt="">';
         echo '<img src="', $WT_IMAGES['hline'], '" height="3" width="', $Dindent - 2, '" alt=""></td><td>';
     }
     print_pedigree_person($person, 1);
     echo '</td>';
     echo '<td>';
     if ($sosa > 1) {
         print_url_arrow($pid, '?rootid=' . $pid . '&amp;PEDIGREE_GENERATIONS=' . $OLD_PGENS . '&amp;show_full=' . $this->show_full . '&amp;box_width=' . $box_width . '&amp;chart_style=' . $this->chart_style . '&amp;ged=' . WT_GEDURL, $label, 3);
     }
     echo '</td>';
     echo '<td class="details1">&nbsp;<span dir="ltr" class="person_box' . ($sosa == 1 ? 'NN' : ($sosa % 2 ? 'F' : '')) . '">&nbsp;', $sosa, '&nbsp;</span>&nbsp;';
     echo '</td><td class="details1">';
     $relation = '';
     $new = ($pid == '' or !isset($pidarr[$pid]));
     if (!$new) {
         $relation = '<br>[=<a href="#sosa' . $pidarr[$pid] . '">' . $pidarr[$pid] . '</a> - ' . get_sosa_name($pidarr[$pid]) . ']';
     } else {
         $pidarr[$pid] = $sosa;
     }
     echo get_sosa_name($sosa) . $relation;
     echo '</td>';
     echo '</tr></table>';
     if (is_null($person)) {
         echo '</li>';
         return;
     }
     // parents
     $family = $person->getPrimaryChildFamily();
     if ($family && $new && $depth > 0) {
         // print marriage info
         echo '<span class="details1" style="white-space: nowrap;" >';
         echo '<img src="', $WT_IMAGES['spacer'], '" height="2" width="', $Dindent, '" align="middle" alt=""><a href="#" onclick="return expand_layer(\'sosa_', $sosa, '\');" class="top"><i id="sosa_', $sosa, '_img" class="icon-minus" title="', WT_I18N::translate('View family'), '"></i></a>';
         echo '&nbsp;<span dir="ltr" class="person_box">&nbsp;', $sosa * 2, '&nbsp;</span>&nbsp;', WT_I18N::translate('and');
         echo '&nbsp;<span dir="ltr" class="person_boxF">&nbsp;', $sosa * 2 + 1, '&nbsp;</span>&nbsp;';
         if ($family->canShow()) {
             foreach ($family->getFacts(WT_EVENTS_MARR) as $fact) {
                 echo ' <a href="', $family->getHtmlUrl(), '" class="details1">', $fact->summary(), '</a>';
             }
         }
         echo '</span>';
         // display parents recursively - or show empty boxes
         echo '<ul style="list-style: none; display: block;" id="sosa_', $sosa, '">';
         $this->print_child_ascendancy($family->getHusband(), $sosa * 2, $depth - 1);
         $this->print_child_ascendancy($family->getWife(), $sosa * 2 + 1, $depth - 1);
         echo '</ul>';
     }
     echo '</li>';
 }