本文整理汇总了PHP中Fisharebest\Webtrees\Individual::canShow方法的典型用法代码示例。如果您正苦于以下问题:PHP Individual::canShow方法的具体用法?PHP Individual::canShow怎么用?PHP Individual::canShow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fisharebest\Webtrees\Individual
的用法示例。
在下文中一共展示了Individual::canShow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: htmlIndividualForList
/**
* Return HTML Code to display individual in non structured list (e.g. Patronymic Lineages)
*
* @param \Fisharebest\Webtrees\Individual $individual Individual to print
* @param bool $isStrong Bolden the name ?
* @return string HTML Code for individual item
*/
public static function htmlIndividualForList(\Fisharebest\Webtrees\Individual $individual, $isStrong = true)
{
$html = '';
$tag = 'em';
if ($isStrong) {
$tag = 'strong';
}
if ($individual && $individual->canShow()) {
$dindi = new Individual($individual);
$html = $individual->getSexImage();
$html .= '<a class="list_item" href="' . $individual->getHtmlUrl() . '" title="' . I18N::translate('Informations for individual %s', $individual->getXref()) . '">';
$html .= '<' . $tag . '>' . $individual->getFullName() . '</' . $tag . '> (' . $individual->getXref() . ') ';
$html .= FunctionsPrint::formatSosaNumbers($dindi->getSosaNumbers(), 1, 'small');
$html .= ' <span><small><em>' . $dindi->formatFirstMajorFact(WT_EVENTS_BIRT, 10) . '</em></small></span>';
$html .= ' <span><small><em>' . $dindi->formatFirstMajorFact(WT_EVENTS_DEAT, 10) . '</em></small></span>';
$html .= '</a>';
} else {
$html .= '<span class=\\"list_item\\"><' . $tag . '>' . I18N::translate('Private') . '</' . $tag . '></span>';
}
return $html;
}
示例2: individualBoxLarge
/**
* Display an individual in a box - for charts, etc.
*
* @param Individual $individual
*
* @return string
*/
public function individualBoxLarge(Individual $individual)
{
$personBoxClass = array_search($individual->getSex(), array('person_box' => 'M', 'person_boxF' => 'F', 'person_boxNN' => 'U'));
if ($individual->getTree()->getPreference('SHOW_HIGHLIGHT_IMAGES')) {
$thumbnail = $individual->displayImage();
} else {
$thumbnail = '';
}
$content = '<span class="namedef name1">' . $individual->getFullName() . '</span>';
$icons = '';
if ($individual->canShow()) {
$content = '<a href="' . $individual->getHtmlUrl() . '">' . $content . '</a>' . '<div class="namedef name2">' . $individual->getAddName() . '</div>';
$icons = '<div class="noprint icons">' . '<span class="iconz icon-zoomin" title="' . I18N::translate('Zoom in/out on this box.') . '"></span>' . '<div class="itr"><i class="icon-pedigree"></i><div class="popup">' . '<ul class="' . $personBoxClass . '">' . implode('', $this->individualBoxMenu($individual)) . '</ul>' . '</div>' . '</div>' . '</div>';
}
return '<div data-pid="' . $individual->getXref() . '" class="person_box_template ' . $personBoxClass . ' box-style2">' . $icons . '<div class="chart_textbox" style="max-height:' . $this->parameter('chart-box-y') . 'px;">' . $thumbnail . $content . '<div class="inout2 details2">' . $this->individualBoxFacts($individual) . '</div>' . '</div>' . '<div class="inout"></div>' . '</div>';
}
示例3: loadSpouses
/**
* Display spouses.
*
* @param Individual $person
* @param int $generations
*
* @return string
*/
public function loadSpouses(Individual $person, $generations)
{
$out = '';
if ($person && $person->canShow()) {
foreach ($person->getSpouseFamilies() as $family) {
$out .= $this->getFamilyLi($family, $person, $generations - 1);
}
}
if ($out) {
return '<ul>' . $out . '</ul>';
} else {
return '';
}
}