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


PHP Family::canShow方法代码示例

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


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

示例1: printFamilyParents


//.........这里部分代码省略.........
             echo '</td></tr></table>';
         }
         echo "</td>";
     }
     if ($hfam && $sosa != -1) {
         echo '<td valign="middle" rowspan="2">';
         self::printUrlArrow($sosa == 0 ? '?famid=' . $hfam->getXref() . '&amp;ged=' . $hfam->getTree()->getNameUrl() : '#' . $hfam->getXref(), $hfam->getXref(), 1);
         echo '</td>';
     }
     if ($hfam) {
         // husband’s mother
         echo "</tr><tr><td><img src=\"" . Theme::theme()->parameter('image-hline') . "\" alt=\"\"></td><td>";
         if ($hfam && $hfam->getWife()) {
             echo "<table border='0'><tr>";
             if ($sosa > 0) {
                 self::printSosaNumber($sosa * 4 + 1, $hfam->getWife()->getXref(), "down");
             }
             if (!empty($gparid) && $hfam->getWife()->getXref() == $gparid) {
                 self::printSosaNumber(trim(substr($label, 0, -3), ".") . ".");
             }
             echo '<td valign="top">';
             FunctionsPrint::printPedigreePerson($hfam->getWife(), $show_full);
             echo '</td></tr></table>';
         } elseif ($hfam && !$hfam->getWife()) {
             // Empty box for grandmother
             echo "<table border='0'><tr>";
             echo '<td valign="top">';
             FunctionsPrint::printPedigreePerson($hfam->getWife(), $show_full);
             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><tr>";
     if ($parid) {
         if ($wife->getXref() == $parid) {
             self::printSosaNumber($label);
         } else {
             self::printSosaNumber($label, "", "blank");
         }
     } elseif ($sosa) {
         self::printSosaNumber($sosa * 2 + 1);
     }
     if ($wife->isPendingAddtion()) {
         echo '<td valign="top" class="facts_value new">';
     } elseif ($wife->isPendingDeletion()) {
         echo '<td valign="top" class="facts_value old">';
     } else {
         echo '<td valign="top">';
     }
     FunctionsPrint::printPedigreePerson($wife, $show_full);
     echo "</td></tr></table>";
开发者ID:pal-saugstad,项目名称:webtrees,代码行数:67,代码来源:FunctionsCharts.php

示例2: loadChildren

 /**
  * Display descendants.
  *
  * @param Family $family
  * @param int    $generations
  *
  * @return string
  */
 public function loadChildren(Family $family, $generations)
 {
     $out = '';
     if ($family->canShow()) {
         $children = $family->getChildren();
         if ($children) {
             foreach ($children as $child) {
                 $out .= $this->getPersonLi($child, $generations - 1);
             }
         } else {
             $out .= '<li class="sb_desc_none">' . I18N::translate('No children') . '</li>';
         }
     }
     if ($out) {
         return '<ul>' . $out . '</ul>';
     } else {
         return '';
     }
 }
开发者ID:tronsmit,项目名称:webtrees,代码行数:27,代码来源:DescendancyModule.php

示例3: printFamily


//.........这里部分代码省略.........
			</tr>
			<?php 
        }
        ///// MARR /////
        $found = false;
        $prev = new Date('');
        foreach ($family->getFacts(WT_EVENTS_MARR . '|' . WT_EVENTS_DIV, true) as $fact) {
            $found |= !$fact->isPendingDeletion();
            if ($fact->isPendingAddition()) {
                $class = ' new';
            } elseif ($fact->isPendingDeletion()) {
                $class = ' old';
            } else {
                $class = '';
            }
            ?>
			<tr>
				<td class="facts_label">
				</td>
				<td class="facts_value<?php 
            echo $class;
            ?>
">
					<?php 
            echo GedcomTag::getLabelValue($fact->getTag(), $fact->getDate()->display() . ' — ' . $fact->getPlace()->getFullName());
            ?>
				</td>
			</tr>
			<?php 
            if (!$prev->isOK() && $fact->getDate()->isOK()) {
                $prev = $fact->getDate();
            }
        }
        if (!$found && $family->canShow() && $family->canEdit()) {
            // Add a new marriage
            ?>
			<tr>
				<td class="facts_label">
				</td>
				<td class="facts_value">
					<a href="#" onclick="return add_new_record('<?php 
            echo $family->getXref();
            ?>
', 'MARR');">
						<?php 
            echo I18N::translate('Add marriage details');
            ?>
					</a>
				</td>
			</tr>
			<?php 
        }
        ///// CHIL /////
        $child_number = 0;
        foreach ($family->getFacts('CHIL', false, $access_level) as $fact) {
            $person = $fact->getTarget();
            if ($person instanceof Individual) {
                if ($fact->isPendingAddition()) {
                    $child_number++;
                    $class = 'facts_label new';
                } elseif ($fact->isPendingDeletion()) {
                    $class = 'facts_label old';
                } else {
                    $child_number++;
                    $class = 'facts_label';
                }
开发者ID:tronsmit,项目名称:webtrees,代码行数:67,代码来源:RelativesTabModule.php

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