本文整理汇总了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() . '&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(' ', 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>";
示例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 '';
}
}
示例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';
}
示例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() . '&generations=' . $this->generations . '&chart_style=' . $this->chart_style . '&show_full=' . $this->showFull() . '&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> ';
}
echo '</td></tr>';
// children
$children = $family->getChildren();
echo '<tr><td colspan="3" class="details1" > ';
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>';
}