当前位置: 首页>>代码示例>>PHP>>正文


PHP Family::getGedcom方法代码示例

本文整理汇总了PHP中Fisharebest\Webtrees\Family::getGedcom方法的典型用法代码示例。如果您正苦于以下问题:PHP Family::getGedcom方法的具体用法?PHP Family::getGedcom怎么用?PHP Family::getGedcom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Fisharebest\Webtrees\Family的用法示例。


在下文中一共展示了Family::getGedcom方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: printFamilyChildren


//.........这里部分代码省略.........
     echo '</td>';
     if ($sosa > 0) {
         echo '<td></td><td></td>';
     }
     echo '</tr>';
     $nchi = 1;
     if ($children) {
         foreach ($children as $child) {
             echo '<tr>';
             if ($sosa != 0) {
                 if ($child->getXref() == $childid) {
                     self::printSosaNumber($sosa, $childid);
                 } elseif (empty($label)) {
                     self::printSosaNumber("");
                 } else {
                     self::printSosaNumber($label . $nchi++ . ".");
                 }
             }
             if ($child->isPendingAddtion()) {
                 echo '<td valign="middle" class="new">';
             } elseif ($child->isPendingDeletion()) {
                 echo '<td valign="middle" class="old">';
             } else {
                 echo '<td valign="middle">';
             }
             FunctionsPrint::printPedigreePerson($child, $show_full);
             echo "</td>";
             if ($sosa != 0) {
                 // loop for all families where current child is a spouse
                 $famids = $child->getSpouseFamilies();
                 $maxfam = count($famids) - 1;
                 for ($f = 0; $f <= $maxfam; $f++) {
                     $famid_child = $famids[$f]->getXref();
                     // multiple marriages
                     if ($f > 0) {
                         echo '</tr><tr><td></td>';
                         echo '<td valign="top"';
                         if (I18N::direction() === 'rtl') {
                             echo ' align="left">';
                         } else {
                             echo ' align="right">';
                         }
                         //find out how many cousins there are to establish vertical line on second families
                         $fchildren = $famids[$f]->getChildren();
                         $kids = count($fchildren);
                         $Pheader = ($bheight - 1) * $kids;
                         $PBadj = 6;
                         // default
                         if ($show_cousins > 0) {
                             if ($kids) {
                                 $PBadj = max(0, $Pheader / 2 + $kids * 4.5);
                             }
                         }
                         if ($f == $maxfam) {
                             echo "<img height=\"" . ($bheight / 2 + $PBadj) . "px\"";
                         } else {
                             echo "<img height=\"" . $pbheight . "px\"";
                         }
                         echo " width=\"3\" src=\"" . Theme::theme()->parameter('image-vline') . "\" alt=\"\">";
                         echo "</td>";
                     }
                     echo "<td class=\"details1\" valign=\"middle\" align=\"center\">";
                     $spouse = $famids[$f]->getSpouse($child);
                     $marr = $famids[$f]->getFirstFact('MARR');
                     $div = $famids[$f]->getFirstFact('DIV');
                     if ($marr) {
                         // marriage date
                         echo $marr->getDate()->minimumDate()->format('%Y');
                         // divorce date
                         if ($div) {
                             echo '–', $div->getDate()->minimumDate()->format('%Y');
                         }
                     }
                     echo "<br><img width=\"100%\" class=\"line5\" height=\"3\" src=\"" . Theme::theme()->parameter('image-hline') . "\" alt=\"\">";
                     echo "</td>";
                     // spouse information
                     echo "<td style=\"vertical-align: center;";
                     if (!empty($divrec)) {
                         echo " filter:alpha(opacity=40);opacity:0.4;\">";
                     } else {
                         echo "\">";
                     }
                     FunctionsPrint::printPedigreePerson($spouse, $show_full);
                     echo "</td>";
                     // cousins
                     if ($show_cousins) {
                         self::printCousins($famid_child, $show_full);
                     }
                 }
             }
             echo "</tr>";
         }
     } elseif ($sosa < 1) {
         // message 'no children' except for sosa
         if (preg_match('/\\n1 NCHI (\\d+)/', $family->getGedcom(), $match) && $match[1] == 0) {
             echo '<tr><td><i class="icon-childless"></i> ' . I18N::translate('This family remained childless') . '</td></tr>';
         }
     }
     echo "</table><br>";
 }
开发者ID:pal-saugstad,项目名称:webtrees,代码行数:101,代码来源:FunctionsCharts.php

示例2: printFamilyDescendancy

 /**
  * print a family descendancy
  *
  * @param Individual $person
  * @param Family     $family
  * @param int        $depth the descendancy depth to show
  */
 private function printFamilyDescendancy(Individual $person, Family $family, $depth)
 {
     $uid = Uuid::uuid4();
     // create a unique ID
     // print marriage info
     echo '<li>';
     echo '<img src="', Theme::theme()->parameter('image-spacer'), '" height="2" width="', Theme::theme()->parameter('chart-descendancy-indent') + 4, '">';
     echo '<span class="details1">';
     echo "<a href=\"#\" onclick=\"expand_layer('" . $uid . "'); return false;\" class=\"top\"><i id=\"" . $uid . "_img\" class=\"icon-minus\" title=\"" . I18N::translate('View this 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 id="' . $uid . '" class="generation">';
     echo '<li>';
     echo '<table><tr><td>';
     FunctionsPrint::printPedigreePerson($spouse, $this->showFull());
     echo '</td>';
     // check if spouse has parents and add an arrow
     echo '<td></td>';
     echo '<td>';
     if ($spouse) {
         foreach ($spouse->getChildFamilies() as $cfamily) {
             foreach ($cfamily->getSpouses() as $parent) {
                 FunctionsCharts::printUrlArrow('?rootid=' . $parent->getXref() . '&amp;generations=' . $this->generations . '&amp;chart_style=' . $this->chart_style . '&amp;show_full=' . $this->showFull() . '&amp;ged=' . $parent->getTree()->getNameUrl(), I18N::translate('Start at parents'), 2);
                 // only show the arrow for one of the parents
                 break;
             }
         }
     }
     if ($this->showFull()) {
         echo '<br><br>&nbsp;';
     }
     echo '</td></tr>';
     // children
     $children = $family->getChildren();
     echo '<tr><td colspan="3" class="details1" >&nbsp;&nbsp;';
     if ($children) {
         echo GedcomTag::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 GedcomTag::getLabel('NCHI') . ': ' . count($children);
         } else {
             echo I18N::translate('No children');
         }
     }
     echo '</td></tr></table>';
     echo '</li>';
     if ($depth > 1) {
         foreach ($children as $child) {
             $this->printChildDescendancy($child, $depth - 1);
         }
     }
     echo '</ul>';
     echo '</li>';
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:69,代码来源:DescendancyController.php


注:本文中的Fisharebest\Webtrees\Family::getGedcom方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。