本文整理汇总了PHP中Fisharebest\Webtrees\GedcomRecord::GetInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP GedcomRecord::GetInstance方法的具体用法?PHP GedcomRecord::GetInstance怎么用?PHP GedcomRecord::GetInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fisharebest\Webtrees\GedcomRecord
的用法示例。
在下文中一共展示了GedcomRecord::GetInstance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: footnoteStartHandler
/**
* XML <Footnote > start element
* Collect the Footnote links
* GEDCOM Records that are protected by Privacy setting will be ignore
*
* @param array $attrs an array of key value pairs for the attributes
*/
private function footnoteStartHandler($attrs)
{
global $WT_TREE;
$id = "";
if (preg_match("/[0-9] (.+) @(.+)@/", $this->gedrec, $match)) {
$id = $match[2];
}
$record = GedcomRecord::GetInstance($id, $WT_TREE);
if ($record && $record->canShow()) {
array_push($this->print_data_stack, $this->print_data);
$this->print_data = true;
$style = "";
if (!empty($attrs['style'])) {
$style = $attrs['style'];
}
$this->footnote_element = $this->current_element;
$this->current_element = $this->report_root->createFootnote($style);
} else {
$this->print_data = false;
$this->process_footnote = false;
}
}
示例2: calendar_list_text
/**
* Format a list of facts for display
*
* @param Fact[] $list
* @param string $tag1
* @param string $tag2
* @param bool $show_sex_symbols
*
* @return string
*/
function calendar_list_text($list, $tag1, $tag2, $show_sex_symbols)
{
global $males, $females, $WT_TREE;
$html = '';
foreach ($list as $id => $facts) {
$tmp = GedcomRecord::GetInstance($id, $WT_TREE);
$html .= $tag1 . '<a href="' . $tmp->getHtmlUrl() . '">' . $tmp->getFullName() . '</a> ';
if ($show_sex_symbols && $tmp instanceof Individual) {
switch ($tmp->getSex()) {
case 'M':
$html .= '<i class="icon-sex_m_9x9" title="' . I18N::translate('Male') . '"></i>';
++$males;
break;
case 'F':
$html .= '<i class="icon-sex_f_9x9" title="' . I18N::translate('Female') . '"></i>';
++$females;
break;
default:
$html .= '<i class="icon-sex_u_9x9" title="' . I18N::translateContext('unknown gender', 'Unknown') . '"></i>';
break;
}
}
$html .= '<div class="indent">' . $facts . '</div>' . $tag2;
}
return $html;
}