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


PHP Module::getActiveSidebars方法代码示例

本文整理汇总了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 '';
        }
    }
开发者ID:tunandras,项目名称:webtrees,代码行数:35,代码来源:IndividualController.php

示例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>';
 }
开发者ID:pal-saugstad,项目名称:webtrees,代码行数:95,代码来源:IndividualFactsTabModule.php


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