18c2e8227SGreg Roach<?php 28c2e8227SGreg Roachnamespace Fisharebest\Webtrees; 38c2e8227SGreg Roach 48c2e8227SGreg Roach/** 58c2e8227SGreg Roach * webtrees: online genealogy 68c2e8227SGreg Roach * Copyright (C) 2015 webtrees development team 78c2e8227SGreg Roach * This program is free software: you can redistribute it and/or modify 88c2e8227SGreg Roach * it under the terms of the GNU General Public License as published by 98c2e8227SGreg Roach * the Free Software Foundation, either version 3 of the License, or 108c2e8227SGreg Roach * (at your option) any later version. 118c2e8227SGreg Roach * This program is distributed in the hope that it will be useful, 128c2e8227SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 138c2e8227SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 148c2e8227SGreg Roach * GNU General Public License for more details. 158c2e8227SGreg Roach * You should have received a copy of the GNU General Public License 168c2e8227SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>. 178c2e8227SGreg Roach */ 188c2e8227SGreg Roach 198c2e8227SGreg Roach/** 208c2e8227SGreg Roach * Class RelativesTabModule 218c2e8227SGreg Roach */ 228c2e8227SGreg Roachclass RelativesTabModule extends Module implements ModuleTabInterface { 238c2e8227SGreg Roach /** {@inheritdoc} */ 248c2e8227SGreg Roach public function getTitle() { 258c2e8227SGreg Roach return /* I18N: Name of a module */ I18N::translate('Families'); 268c2e8227SGreg Roach } 278c2e8227SGreg Roach 288c2e8227SGreg Roach /** {@inheritdoc} */ 298c2e8227SGreg Roach public function getDescription() { 308c2e8227SGreg Roach return /* I18N: Description of the “Families” module */ I18N::translate('A tab showing the close relatives of an individual.'); 318c2e8227SGreg Roach } 328c2e8227SGreg Roach 338c2e8227SGreg Roach /** {@inheritdoc} */ 348c2e8227SGreg Roach public function defaultTabOrder() { 358c2e8227SGreg Roach return 20; 368c2e8227SGreg Roach } 378c2e8227SGreg Roach 388c2e8227SGreg Roach /** 398c2e8227SGreg Roach * @param Date $prev 408c2e8227SGreg Roach * @param Date $next 418c2e8227SGreg Roach * @param integer $child_number 428c2e8227SGreg Roach * 438c2e8227SGreg Roach * @return string 448c2e8227SGreg Roach */ 458c2e8227SGreg Roach static function ageDifference(Date $prev, Date $next, $child_number = 0) { 468c2e8227SGreg Roach if ($prev->isOK() && $next->isOK()) { 478c2e8227SGreg Roach $days = $next->maximumJulianDay() - $prev->minimumJulianDay(); 488c2e8227SGreg Roach if ($days < 0) { 498c2e8227SGreg Roach // Show warning triangle if dates in reverse order 508c2e8227SGreg Roach $diff = '<i class="icon-warning"></i> '; 518c2e8227SGreg Roach } elseif ($child_number > 1 && $days > 1 && $days < 240) { 528c2e8227SGreg Roach // Show warning triangle if children born too close together 538c2e8227SGreg Roach $diff = '<i class="icon-warning"></i> '; 548c2e8227SGreg Roach } else { 558c2e8227SGreg Roach $diff = ''; 568c2e8227SGreg Roach } 578c2e8227SGreg Roach 588c2e8227SGreg Roach $months = round($days * 12 / 365.25); // Approximate - we do not know the calendar 598c2e8227SGreg Roach if (abs($months) == 12 || abs($months) >= 24) { 608c2e8227SGreg Roach $diff .= I18N::plural('%d year', '%d years', round($months / 12), round($months / 12)); 618c2e8227SGreg Roach } elseif ($months != 0) { 628c2e8227SGreg Roach $diff .= I18N::plural('%d month', '%d months', $months, $months); 638c2e8227SGreg Roach } 648c2e8227SGreg Roach 658c2e8227SGreg Roach return '<div class="elderdate age">' . $diff . '</div>'; 668c2e8227SGreg Roach } else { 678c2e8227SGreg Roach return ''; 688c2e8227SGreg Roach } 698c2e8227SGreg Roach } 708c2e8227SGreg Roach 718c2e8227SGreg Roach /** 728c2e8227SGreg Roach * @param Family $family 738c2e8227SGreg Roach * @param string $type 748c2e8227SGreg Roach * @param string $label 758c2e8227SGreg Roach */ 768c2e8227SGreg Roach function printFamily(Family $family, $type, $label) { 778c2e8227SGreg Roach global $controller; 788c2e8227SGreg Roach global $SHOW_PRIVATE_RELATIONSHIPS; 798c2e8227SGreg Roach 808c2e8227SGreg Roach if ($SHOW_PRIVATE_RELATIONSHIPS) { 818c2e8227SGreg Roach $access_level = WT_PRIV_HIDE; 828c2e8227SGreg Roach } else { 838c2e8227SGreg Roach $access_level = WT_USER_ACCESS_LEVEL; 848c2e8227SGreg Roach } 858c2e8227SGreg Roach 868c2e8227SGreg Roach ?> 878c2e8227SGreg Roach <table> 888c2e8227SGreg Roach <tr> 898c2e8227SGreg Roach <td> 908c2e8227SGreg Roach <i class="icon-cfamily"></i> 918c2e8227SGreg Roach </td> 928c2e8227SGreg Roach <td> 938c2e8227SGreg Roach <span class="subheaders"> <?php echo $label; ?> </span> - 948c2e8227SGreg Roach <a href="<?php echo $family->getHtmlUrl(); ?>"><?php echo I18N::translate('View family'); ?></a> 958c2e8227SGreg Roach </td> 968c2e8227SGreg Roach </tr> 978c2e8227SGreg Roach </table> 988c2e8227SGreg Roach <table class="facts_table"> 998c2e8227SGreg Roach <?php 1008c2e8227SGreg Roach 1018c2e8227SGreg Roach ///// HUSB ///// 1028c2e8227SGreg Roach $found = false; 1038c2e8227SGreg Roach foreach ($family->getFacts('HUSB', false, $access_level) as $fact) { 1048c2e8227SGreg Roach $found |= !$fact->isPendingDeletion(); 1058c2e8227SGreg Roach $person = $fact->getTarget(); 1068c2e8227SGreg Roach if ($person instanceof Individual) { 1078c2e8227SGreg Roach if ($fact->isPendingAddition()) { 1088c2e8227SGreg Roach $class = 'facts_label new'; 1098c2e8227SGreg Roach } elseif ($fact->isPendingDeletion()) { 1108c2e8227SGreg Roach $class = 'facts_label old'; 1118c2e8227SGreg Roach } else { 1128c2e8227SGreg Roach $class = 'facts_label'; 1138c2e8227SGreg Roach } 1148c2e8227SGreg Roach ?> 1158c2e8227SGreg Roach <tr> 1168c2e8227SGreg Roach <td class="<?php echo $class; ?>"> 1178c2e8227SGreg Roach <?php echo get_close_relationship_name($controller->record, $person); ?> 1188c2e8227SGreg Roach </td> 1198c2e8227SGreg Roach <td class="<?php echo $controller->getPersonStyle($person); ?>"> 1208c2e8227SGreg Roach <?php echo Theme::theme()->individualBoxLarge($person); ?> 1218c2e8227SGreg Roach </td> 1228c2e8227SGreg Roach </tr> 1238c2e8227SGreg Roach <?php 1248c2e8227SGreg Roach } 1258c2e8227SGreg Roach } 1268c2e8227SGreg Roach if (!$found && $family->canEdit()) { 1278c2e8227SGreg Roach ?> 1288c2e8227SGreg Roach <tr> 1298c2e8227SGreg Roach <td class="facts_label"></td> 1308c2e8227SGreg Roach <td class="facts_value"><a href="#" onclick="return add_spouse_to_family('<?php echo $family->getXref(); ?>', 'HUSB');"><?php echo I18N::translate('Add a husband to this family'); ?></a></td> 1318c2e8227SGreg Roach </tr> 1328c2e8227SGreg Roach <?php 1338c2e8227SGreg Roach } 1348c2e8227SGreg Roach 1358c2e8227SGreg Roach ///// WIFE ///// 1368c2e8227SGreg Roach $found = false; 1378c2e8227SGreg Roach foreach ($family->getFacts('WIFE', false, $access_level) as $fact) { 1388c2e8227SGreg Roach $person = $fact->getTarget(); 1398c2e8227SGreg Roach if ($person instanceof Individual) { 1408c2e8227SGreg Roach $found |= !$fact->isPendingDeletion(); 1418c2e8227SGreg Roach if ($fact->isPendingAddition()) { 1428c2e8227SGreg Roach $class = 'facts_label new'; 1438c2e8227SGreg Roach } elseif ($fact->isPendingDeletion()) { 1448c2e8227SGreg Roach $class = 'facts_label old'; 1458c2e8227SGreg Roach } else { 1468c2e8227SGreg Roach $class = 'facts_label'; 1478c2e8227SGreg Roach } 1488c2e8227SGreg Roach ?> 1498c2e8227SGreg Roach <tr> 1508c2e8227SGreg Roach <td class="<?php echo $class; ?>"> 1518c2e8227SGreg Roach <?php echo get_close_relationship_name($controller->record, $person); ?> 1528c2e8227SGreg Roach </td> 1538c2e8227SGreg Roach <td class="<?php echo $controller->getPersonStyle($person); ?>"> 1548c2e8227SGreg Roach <?php echo Theme::theme()->individualBoxLarge($person); ?> 1558c2e8227SGreg Roach </td> 1568c2e8227SGreg Roach </tr> 1578c2e8227SGreg Roach <?php 1588c2e8227SGreg Roach } 1598c2e8227SGreg Roach } 1608c2e8227SGreg Roach if (!$found && $family->canEdit()) { 1618c2e8227SGreg Roach ?> 1628c2e8227SGreg Roach <tr> 1638c2e8227SGreg Roach <td class="facts_label"></td> 1648c2e8227SGreg Roach <td class="facts_value"><a href="#" onclick="return add_spouse_to_family('<?php echo $family->getXref(); ?>', 'WIFE');"><?php echo I18N::translate('Add a wife to this family'); ?></a></td> 1658c2e8227SGreg Roach </tr> 1668c2e8227SGreg Roach <?php 1678c2e8227SGreg Roach } 1688c2e8227SGreg Roach 1698c2e8227SGreg Roach ///// MARR ///// 1708c2e8227SGreg Roach $found = false; 1718c2e8227SGreg Roach $prev = new Date(''); 1728c2e8227SGreg Roach foreach ($family->getFacts(WT_EVENTS_MARR) as $fact) { 1738c2e8227SGreg Roach $found |= !$fact->isPendingDeletion(); 1748c2e8227SGreg Roach if ($fact->isPendingAddition()) { 1758c2e8227SGreg Roach $class = ' new'; 1768c2e8227SGreg Roach } elseif ($fact->isPendingDeletion()) { 1778c2e8227SGreg Roach $class = ' old'; 1788c2e8227SGreg Roach } else { 1798c2e8227SGreg Roach $class = ''; 1808c2e8227SGreg Roach } 1818c2e8227SGreg Roach ?> 1828c2e8227SGreg Roach <tr> 1838c2e8227SGreg Roach <td class="facts_label"> 1848c2e8227SGreg Roach 1858c2e8227SGreg Roach </td> 1868c2e8227SGreg Roach <td class="facts_value<?php echo $class; ?>"> 187*764a01d9SGreg Roach <?php echo GedcomTag::getLabelValue($fact->getTag(), $fact->getDate()->display() . ' — ' . $fact->getPlace()->getFullName()); ?> 1888c2e8227SGreg Roach </td> 1898c2e8227SGreg Roach </tr> 1908c2e8227SGreg Roach <?php 1918c2e8227SGreg Roach if (!$prev->isOK() && $fact->getDate()->isOK()) { 1928c2e8227SGreg Roach $prev = $fact->getDate(); 1938c2e8227SGreg Roach } 1948c2e8227SGreg Roach } 1958c2e8227SGreg Roach if (!$found && $family->canShow() && $family->canEdit()) { 1968c2e8227SGreg Roach // Add a new marriage 1978c2e8227SGreg Roach ?> 1988c2e8227SGreg Roach <tr> 1998c2e8227SGreg Roach <td class="facts_label"> 2008c2e8227SGreg Roach 2018c2e8227SGreg Roach </td> 2028c2e8227SGreg Roach <td class="facts_value"> 2038c2e8227SGreg Roach <a href="#" onclick="return add_new_record('<?php echo $family->getXref(); ?>', 'MARR');"> 2048c2e8227SGreg Roach <?php echo I18N::translate('Add marriage details'); ?> 2058c2e8227SGreg Roach </a> 2068c2e8227SGreg Roach </td> 2078c2e8227SGreg Roach </tr> 2088c2e8227SGreg Roach <?php 2098c2e8227SGreg Roach } 2108c2e8227SGreg Roach 2118c2e8227SGreg Roach ///// CHIL ///// 2128c2e8227SGreg Roach $child_number = 0; 2138c2e8227SGreg Roach foreach ($family->getFacts('CHIL', false, $access_level) as $fact) { 2148c2e8227SGreg Roach $person = $fact->getTarget(); 2158c2e8227SGreg Roach if ($person instanceof Individual) { 2168c2e8227SGreg Roach if ($fact->isPendingAddition()) { 2178c2e8227SGreg Roach $child_number++; 2188c2e8227SGreg Roach $class = 'facts_label new'; 2198c2e8227SGreg Roach } elseif ($fact->isPendingDeletion()) { 2208c2e8227SGreg Roach $class = 'facts_label old'; 2218c2e8227SGreg Roach } else { 2228c2e8227SGreg Roach $child_number++; 2238c2e8227SGreg Roach $class = 'facts_label'; 2248c2e8227SGreg Roach } 2258c2e8227SGreg Roach $next = new Date(''); 2268c2e8227SGreg Roach foreach ($person->getFacts(WT_EVENTS_BIRT) as $bfact) { 2278c2e8227SGreg Roach if ($bfact->getDate()->isOK()) { 2288c2e8227SGreg Roach $next = $bfact->getDate(); 2298c2e8227SGreg Roach break; 2308c2e8227SGreg Roach } 2318c2e8227SGreg Roach } 2328c2e8227SGreg Roach ?> 2338c2e8227SGreg Roach <tr> 2348c2e8227SGreg Roach <td class="<?php echo $class; ?>"> 2358c2e8227SGreg Roach <?php echo self::ageDifference($prev, $next, $child_number); ?> 2368c2e8227SGreg Roach <?php echo get_close_relationship_name($controller->record, $person); ?> 2378c2e8227SGreg Roach </td> 2388c2e8227SGreg Roach <td class="<?php echo $controller->getPersonStyle($person); ?>"> 2398c2e8227SGreg Roach <?php echo Theme::theme()->individualBoxLarge($person); ?> 2408c2e8227SGreg Roach </td> 2418c2e8227SGreg Roach </tr> 2428c2e8227SGreg Roach <?php 2438c2e8227SGreg Roach $prev = $next; 2448c2e8227SGreg Roach } 2458c2e8227SGreg Roach } 2468c2e8227SGreg Roach // Re-order children / add a new child 2478c2e8227SGreg Roach if ($family->canEdit()) { 2488c2e8227SGreg Roach if ($type == 'FAMS') { 2498c2e8227SGreg Roach $add_child_text = I18N::translate('Add a new son or daughter'); 2508c2e8227SGreg Roach } else { 2518c2e8227SGreg Roach $add_child_text = I18N::translate('Add a new brother or sister'); 2528c2e8227SGreg Roach } 2538c2e8227SGreg Roach ?> 2548c2e8227SGreg Roach <tr> 2558c2e8227SGreg Roach <td class="facts_label"> 2568c2e8227SGreg Roach <?php if (count($family->getChildren()) > 1) { ?> 2578c2e8227SGreg Roach <a href="#" onclick="reorder_children('<?php echo $family->getXref(); ?>');tabswitch(5);"><i class="icon-media-shuffle"></i> <?php echo I18N::translate('Re-order children'); ?></a> 2588c2e8227SGreg Roach <?php } ?> 2598c2e8227SGreg Roach </td> 2608c2e8227SGreg Roach <td class="facts_value"> 2618c2e8227SGreg Roach <a href="#" onclick="return add_child_to_family('<?php echo $family->getXref(); ?>');"><?php echo $add_child_text; ?></a> 2628c2e8227SGreg Roach <span style='white-space:nowrap;'> 2638c2e8227SGreg Roach <a href="#" class="icon-sex_m_15x15" onclick="return add_child_to_family('<?php echo $family->getXref(); ?>','M');"></a> 2648c2e8227SGreg Roach <a href="#" class="icon-sex_f_15x15" onclick="return add_child_to_family('<?php echo $family->getXref(); ?>','F');"></a> 2658c2e8227SGreg Roach </span> 2668c2e8227SGreg Roach </td> 2678c2e8227SGreg Roach </tr> 2688c2e8227SGreg Roach <?php 2698c2e8227SGreg Roach } 2708c2e8227SGreg Roach 2718c2e8227SGreg Roach echo '</table>'; 2728c2e8227SGreg Roach 2738c2e8227SGreg Roach return; 2748c2e8227SGreg Roach } 2758c2e8227SGreg Roach 2768c2e8227SGreg Roach /** {@inheritdoc} */ 2778c2e8227SGreg Roach public function getTabContent() { 2788c2e8227SGreg Roach global $WT_TREE, $show_full, $controller; 2798c2e8227SGreg Roach 2808c2e8227SGreg Roach if (isset($show_full)) { 2818c2e8227SGreg Roach $saved_show_full = $show_full; 2828c2e8227SGreg Roach } 2838c2e8227SGreg Roach // We always want to see full details here 2848c2e8227SGreg Roach $show_full = 1; 2858c2e8227SGreg Roach 2868c2e8227SGreg Roach ob_start(); 2878c2e8227SGreg Roach ?> 2888c2e8227SGreg Roach <table class="facts_table"><tr><td class="descriptionbox rela"> 2898c2e8227SGreg Roach <input id="checkbox_elder" type="checkbox" onclick="jQuery('div.elderdate').toggle();" <?php echo $WT_TREE->getPreference('SHOW_AGE_DIFF') ? 'checked' : ''; ?>> 2908c2e8227SGreg Roach <label for="checkbox_elder"><?php echo I18N::translate('Show date differences'); ?></label> 2918c2e8227SGreg Roach </td></tr></table> 2928c2e8227SGreg Roach <?php 2938c2e8227SGreg Roach $families = $controller->record->getChildFamilies(); 2948c2e8227SGreg Roach if (!$families && $controller->record->canEdit()) { 2958c2e8227SGreg Roach ?> 2968c2e8227SGreg Roach <table class="facts_table"> 2978c2e8227SGreg Roach <tr> 2988c2e8227SGreg Roach <td class="facts_value"><a href="#" onclick="return add_parent_to_individual('<?php echo $controller->record->getXref(); ?>', 'M');"><?php echo I18N::translate('Add a new father'); ?></td> 2998c2e8227SGreg Roach </tr> 3008c2e8227SGreg Roach <tr> 3018c2e8227SGreg Roach <td class="facts_value"><a href="#" onclick="return add_parent_to_individual('<?php echo $controller->record->getXref(); ?>', 'F');"><?php echo I18N::translate('Add a new mother'); ?></a></td> 3028c2e8227SGreg Roach </tr> 3038c2e8227SGreg Roach </table> 3048c2e8227SGreg Roach <?php 3058c2e8227SGreg Roach } 3068c2e8227SGreg Roach 3078c2e8227SGreg Roach // parents 3088c2e8227SGreg Roach foreach ($families as $family) { 3098c2e8227SGreg Roach $this->printFamily($family, 'FAMC', $controller->record->getChildFamilyLabel($family)); 3108c2e8227SGreg Roach } 3118c2e8227SGreg Roach 3128c2e8227SGreg Roach // step-parents 3138c2e8227SGreg Roach foreach ($controller->record->getChildStepFamilies() as $family) { 3148c2e8227SGreg Roach $this->printFamily($family, 'FAMC', $controller->record->getStepFamilyLabel($family)); 3158c2e8227SGreg Roach } 3168c2e8227SGreg Roach 3178c2e8227SGreg Roach // spouses 3188c2e8227SGreg Roach $families = $controller->record->getSpouseFamilies(); 3198c2e8227SGreg Roach foreach ($families as $family) { 3208c2e8227SGreg Roach $this->printFamily($family, 'FAMS', $controller->record->getSpouseFamilyLabel($family)); 3218c2e8227SGreg Roach } 3228c2e8227SGreg Roach 3238c2e8227SGreg Roach // step-children 3248c2e8227SGreg Roach foreach ($controller->record->getSpouseStepFamilies() as $family) { 3258c2e8227SGreg Roach $this->printFamily($family, 'FAMS', $family->getFullName()); 3268c2e8227SGreg Roach } 3278c2e8227SGreg Roach 3288c2e8227SGreg Roach if (!$WT_TREE->getPreference('SHOW_AGE_DIFF')) { 3298c2e8227SGreg Roach echo '<script>jQuery("DIV.elderdate").toggle();</script>'; 3308c2e8227SGreg Roach } 3318c2e8227SGreg Roach 3328c2e8227SGreg Roach if ($controller->record->canEdit()) { 3338c2e8227SGreg Roach ?> 3348c2e8227SGreg Roach <br><table class="facts_table"> 3358c2e8227SGreg Roach <?php 3368c2e8227SGreg Roach if (count($families) > 1) { ?> 3378c2e8227SGreg Roach <tr> 3388c2e8227SGreg Roach <td class="facts_value"> 3398c2e8227SGreg Roach <a href="#" onclick="return reorder_families('<?php echo $controller->record->getXref(); ?>');"><?php echo I18N::translate('Re-order families'); ?></a> 3408c2e8227SGreg Roach </td> 3418c2e8227SGreg Roach </tr> 3428c2e8227SGreg Roach <?php } ?> 3438c2e8227SGreg Roach <tr> 3448c2e8227SGreg Roach <td class="facts_value"> 3458c2e8227SGreg Roach <a href="#" onclick="return add_famc('<?php echo $controller->record->getXref(); ?>');"><?php echo I18N::translate('Link this individual to an existing family as a child'); ?></a> 3468c2e8227SGreg Roach </td> 3478c2e8227SGreg Roach </tr> 3488c2e8227SGreg Roach <?php if ($controller->record->getSex() != "F") { ?> 3498c2e8227SGreg Roach <tr> 3508c2e8227SGreg Roach <td class="facts_value"> 3518c2e8227SGreg Roach <a href="#" onclick="return add_spouse_to_individual('<?php echo $controller->record->getXref(); ?>','WIFE');"><?php echo I18N::translate('Add a new wife'); ?></a> 3528c2e8227SGreg Roach </td> 3538c2e8227SGreg Roach </tr> 3548c2e8227SGreg Roach <tr> 3558c2e8227SGreg Roach <td class="facts_value"> 3568c2e8227SGreg Roach <a href="#" onclick="return linkspouse('<?php echo $controller->record->getXref(); ?>','WIFE');"><?php echo I18N::translate('Add a wife using an existing individual'); ?></a> 3578c2e8227SGreg Roach </td> 3588c2e8227SGreg Roach </tr> 3598c2e8227SGreg Roach <?php } 3608c2e8227SGreg Roach if ($controller->record->getSex() != "M") { ?> 3618c2e8227SGreg Roach <tr> 3628c2e8227SGreg Roach <td class="facts_value"> 3638c2e8227SGreg Roach <a href="#" onclick="return add_spouse_to_individual('<?php echo $controller->record->getXref(); ?>','HUSB');"><?php echo I18N::translate('Add a new husband'); ?></a> 3648c2e8227SGreg Roach </td> 3658c2e8227SGreg Roach </tr> 3668c2e8227SGreg Roach <tr> 3678c2e8227SGreg Roach <td class="facts_value"> 3688c2e8227SGreg Roach <a href="#" onclick="return linkspouse('<?php echo $controller->record->getXref(); ?>','HUSB');"><?php echo I18N::translate('Add a husband using an existing individual'); ?></a> 3698c2e8227SGreg Roach </td> 3708c2e8227SGreg Roach </tr> 3718c2e8227SGreg Roach <?php } ?> 3728c2e8227SGreg Roach <tr> 3738c2e8227SGreg Roach <td class="facts_value"> 3748c2e8227SGreg Roach <a href="#" onclick="return add_child_to_individual('<?php echo $controller->record->getXref(); ?>','U');"><?php echo I18N::translate('Add a child to create a one-parent family'); ?></a> 3758c2e8227SGreg Roach </td> 3768c2e8227SGreg Roach </tr> 3778c2e8227SGreg Roach </table> 3788c2e8227SGreg Roach <?php } ?> 3798c2e8227SGreg Roach <br> 3808c2e8227SGreg Roach <?php 3818c2e8227SGreg Roach 3828c2e8227SGreg Roach unset($show_full); 3838c2e8227SGreg Roach if (isset($saved_show_full)) { 3848c2e8227SGreg Roach $show_full = $saved_show_full; 3858c2e8227SGreg Roach } 3868c2e8227SGreg Roach 3878c2e8227SGreg Roach return '<div id="' . $this->getName() . '_content">' . ob_get_clean() . '</div>'; 3888c2e8227SGreg Roach } 3898c2e8227SGreg Roach 3908c2e8227SGreg Roach /** {@inheritdoc} */ 3918c2e8227SGreg Roach public function hasTabContent() { 3928c2e8227SGreg Roach return true; 3938c2e8227SGreg Roach } 3948c2e8227SGreg Roach /** {@inheritdoc} */ 3958c2e8227SGreg Roach public function isGrayedOut() { 3968c2e8227SGreg Roach return false; 3978c2e8227SGreg Roach } 3988c2e8227SGreg Roach /** {@inheritdoc} */ 3998c2e8227SGreg Roach public function canLoadAjax() { 4008c2e8227SGreg Roach return !Auth::isSearchEngine(); // Search engines cannot use AJAX 4018c2e8227SGreg Roach } 4028c2e8227SGreg Roach 4038c2e8227SGreg Roach /** {@inheritdoc} */ 4048c2e8227SGreg Roach public function getPreLoadContent() { 4058c2e8227SGreg Roach return ''; 4068c2e8227SGreg Roach } 4078c2e8227SGreg Roach} 408