summaryrefslogtreecommitdiff
path: root/includes/controllers
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2010-12-22 16:54:49 +0000
committerfisharebest <fisharebest@gmail.com>2010-12-22 16:54:49 +0000
commit709813033f7e03b4425ffc3b0cbe78e6563f7bca (patch)
tree6e489e1710ca8ed296cf0b11223bf90cfcfe65d3 /includes/controllers
parent44b4ec9005b9414f9015f44f36c139323bf8193d (diff)
downloadwebtrees-709813033f7e03b4425ffc3b0cbe78e6563f7bca.tar.gz
webtrees-709813033f7e03b4425ffc3b0cbe78e6563f7bca.tar.bz2
webtrees-709813033f7e03b4425ffc3b0cbe78e6563f7bca.zip
Use proper object access
Diffstat (limited to 'includes/controllers')
-rw-r--r--includes/controllers/descendancy_ctrl.php20
1 files changed, 6 insertions, 14 deletions
diff --git a/includes/controllers/descendancy_ctrl.php b/includes/controllers/descendancy_ctrl.php
index 92c5136c6f..7c5a2efd36 100644
--- a/includes/controllers/descendancy_ctrl.php
+++ b/includes/controllers/descendancy_ctrl.php
@@ -209,20 +209,13 @@ function print_family_descendancy(&$person, &$family, $depth) {
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"];
-
+ $spouse=$family->getSpouse($person);
+ if ($spouse) {
// print marriage info
echo "<li>";
echo "<img src=\"".$WT_IMAGES["spacer"]."\" height=\"2\" width=\"".($Dindent+4)."\" border=\"0\" alt=\"\" />";
echo "<span class=\"details1\" style=\"white-space: nowrap; \" >";
- echo "<a href=\"#\" onclick=\"expand_layer('".$famid.$personcount."'); return false;\" class=\"top\"><img id=\"".$famid.$personcount."_img\" src=\"".$WT_IMAGES["minus"]."\" align=\"middle\" hspace=\"0\" vspace=\"3\" border=\"0\" alt=\"".i18n::translate('View Family')."\" /></a>";
+ echo "<a href=\"#\" onclick=\"expand_layer('".$family->getXref().$personcount."'); return false;\" class=\"top\"><img id=\"".$family->getXref().$personcount."_img\" src=\"".$WT_IMAGES["minus"]."\" align=\"middle\" hspace=\"0\" vspace=\"3\" border=\"0\" alt=\"".i18n::translate('View Family')."\" /></a>";
$marriage = $family->getMarriage();
if ($marriage->canShow()) {
echo ' <a href="', $family->getHtmlUrl(), '" class="details1">';
@@ -232,17 +225,16 @@ function print_family_descendancy(&$person, &$family, $depth) {
echo '</span>';
// print spouse
- echo "<ul style=\"list-style: none; display: block;\" id=\"".$famid.$personcount."\">";
+ 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($id, 1, 0, $personcount);
+ print_pedigree_person($spouse->getXref(), 1, 0, $personcount);
echo "</td>";
// check if spouse has parents and add an arrow
echo "<td>&nbsp;</td>";
echo "<td>";
- $sfamids = find_family_ids($id);
- foreach ($sfamids as $indexval => $sfamid) {
+ foreach ($spouse->getChildFamilyIds() as $sfamid) {
$parents = find_parents($sfamid);
if ($parents) {
$parid=$parents["HUSB"];