本文整理汇总了PHP中Fisharebest\Webtrees\Module::getActiveSidebars方法的典型用法代码示例。如果您正苦于以下问题:PHP Module::getActiveSidebars方法的具体用法?PHP Module::getActiveSidebars怎么用?PHP Module::getActiveSidebars使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fisharebest\Webtrees\Module
的用法示例。
在下文中一共展示了Module::getActiveSidebars方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSideBarContent
/**
* Get the contents of sidebar.
*
* @return string
*/
public function getSideBarContent()
{
global $controller;
$html = '';
$active = 0;
$n = 0;
foreach (Module::getActiveSidebars($this->record->getTree()) as $mod) {
if ($mod->hasSidebarContent()) {
$html .= '<h3 id="' . $mod->getName() . '"><a href="#">' . $mod->getTitle() . '</a></h3>';
$html .= '<div id="sb_content_' . $mod->getName() . '">' . $mod->getSidebarContent() . '</div>';
// The family navigator should be opened by default
if ($mod->getName() == 'family_nav') {
$active = $n;
}
++$n;
}
}
if ($html) {
$controller->addInlineJavascript('
jQuery("#sidebarAccordion").accordion({
active:' . $active . ',
heightStyle: "content",
collapsible: true,
});
');
return '<div id="sidebar"><div id="sidebarAccordion">' . $html . '</div></div>';
} else {
return '';
}
}
示例2: getTabContent
/** {@inheritdoc} */
public function getTabContent()
{
global $controller;
$EXPAND_HISTO_EVENTS = false;
$indifacts = array();
// The individual’s own facts
foreach ($controller->record->getFacts() as $fact) {
switch ($fact->getTag()) {
case 'SEX':
case 'NAME':
case 'SOUR':
case 'OBJE':
case 'NOTE':
case 'FAMC':
case 'FAMS':
break;
default:
if (!array_key_exists('extra_info', Module::getActiveSidebars($controller->record->getTree())) || !ExtraInformationModule::showFact($fact)) {
$indifacts[] = $fact;
}
break;
}
}
// Add spouse-family facts
foreach ($controller->record->getSpouseFamilies() as $family) {
foreach ($family->getFacts() as $fact) {
switch ($fact->getTag()) {
case 'SOUR':
case 'NOTE':
case 'OBJE':
case 'CHAN':
case '_UID':
case 'RIN':
case 'HUSB':
case 'WIFE':
case 'CHIL':
break;
default:
$indifacts[] = $fact;
break;
}
}
$spouse = $family->getSpouse($controller->record);
if ($spouse) {
foreach (self::spouseFacts($controller->record, $spouse) as $fact) {
$indifacts[] = $fact;
}
}
foreach (self::childFacts($controller->record, $family, '_CHIL', '') as $fact) {
$indifacts[] = $fact;
}
}
foreach (self::parentFacts($controller->record, 1) as $fact) {
$indifacts[] = $fact;
}
foreach (self::historicalFacts($controller->record) as $fact) {
$indifacts[] = $fact;
}
foreach (self::associateFacts($controller->record) as $fact) {
$indifacts[] = $fact;
}
Functions::sortFacts($indifacts);
ob_start();
echo '<table class="facts_table">';
echo '<tbody>';
if (!$indifacts) {
echo '<tr><td colspan="2" class="facts_value">', I18N::translate('There are no facts for this individual.'), '</td></tr>';
}
echo '<tr><td colspan="2" class="descriptionbox rela"><form action="?"><input id="checkbox_rela_facts" type="checkbox" ';
echo $controller->record->getTree()->getPreference('EXPAND_RELATIVES_EVENTS') ? 'checked' : '';
echo ' onclick="jQuery(\'tr.rela\').toggle();"><label for="checkbox_rela_facts">', I18N::translate('Events of close relatives'), '</label>';
if (file_exists(Site::getPreference('INDEX_DIRECTORY') . 'histo.' . WT_LOCALE . '.php')) {
echo ' <input id="checkbox_histo" type="checkbox" ';
echo $EXPAND_HISTO_EVENTS ? 'checked' : '';
echo ' onclick="jQuery(\'tr.histo\').toggle();"><label for="checkbox_histo">', I18N::translate('Historical facts'), '</label>';
}
echo '</form></td></tr>';
foreach ($indifacts as $fact) {
FunctionsPrintFacts::printFact($fact, $controller->record);
}
//-- new fact link
if ($controller->record->canEdit()) {
FunctionsPrint::printAddNewFact($controller->record->getXref(), $indifacts, 'INDI');
}
echo '</tbody>';
echo '</table>';
if (!$controller->record->getTree()->getPreference('EXPAND_RELATIVES_EVENTS')) {
echo '<script>jQuery("tr.rela").toggle();</script>';
}
if (!$EXPAND_HISTO_EVENTS) {
echo '<script>jQuery("tr.histo").toggle();</script>';
}
return '<div id="' . $this->getName() . '_content">' . ob_get_clean() . '</div>';
}