get_facts();
}
// Implement WT_Module_Tab
public function isGrayedOut() {
return !$this->get_facts();
}
// Implement WT_Module_Tab
public function getTabContent() {
global $SHOW_LEVEL2_NOTES, $NAV_SOURCES, $controller;
ob_start();
echo '
jQuery("tr.row_sour2").toggle();';
}
return ''.ob_get_clean().'
';
}
function get_facts() {
global $controller;
if ($this->facts === null) {
$facts = $controller->record->getFacts();
foreach ($controller->record->getSpouseFamilies() as $family) {
if ($family->canShow()) {
foreach ($family->getFacts() as $fact) {
$facts[] = $fact;
}
}
}
$this->facts = array();
foreach ($facts as $fact) {
if (preg_match('/(?:^1|\n\d) SOUR/', $fact->getGedcom())) {
$this->facts[] = $fact;
}
}
sort_facts($this->facts);
}
return $this->facts;
}
// Implement WT_Module_Tab
public function canLoadAjax() {
global $SEARCH_SPIDER;
return !$SEARCH_SPIDER; // Search engines cannot use AJAX
}
// Implement WT_Module_Tab
public function getPreLoadContent() {
return '';
}
}