pid = $pid;
}
$pid = safe_GET_xref('rootid', '');
if (empty($pid)) $pid = safe_POST_xref('rootid', '');
if (!empty($pid)) {
$controller->pid = $pid;
}
$famid = safe_GET('famid', WT_REGEX_XREF, '');
if (empty($famid)) $famid = safe_POST('famid', WT_REGEX_XREF, '');
if (!empty($famid)) {
$controller->famid = $famid;
}
$sid = safe_GET('sid', WT_REGEX_XREF, '');
if (empty($sid)) $sid = safe_POST('sid', WT_REGEX_XREF, '');
if (!empty($sid)) {
$controller->sid = $sid;
}
if ($sb_action=='loadMods') {
$counter = 0;
foreach ($sidebarmods as $mod) {
if (isset($controller)) $mod->setController($controller);
if ($mod->hasSidebarContent()) {
echo '
';
if ($counter==0) {
echo $mod->getSidebarContent();
} else {
echo '

';
}
echo '
';
$counter++;
}
}
exit;
}
if ($sb_action=='loadmod') {
$modName = safe_GET('mod', WT_REGEX_URL, '');
if (isset($sidebarmods[$modName])) {
$mod = $sidebarmods[$modName];
if (isset($controller)) $mod->setController($controller);
echo $mod->getSidebarContent();
}
exit;
}
if (isset($sidebarmods[$sb_action])) {
$mod = $sidebarmods[$sb_action];
echo $mod->getSidebarAjaxContent();
}
exit;
}
global $controller;
$pid='';
$famid='';
if (isset($controller)) {
if (isset($controller->pid)) $pid = $controller->pid;
if (isset($controller->rootid)) $pid = $controller->rootid;
if (isset($controller->famid)) $famid = $controller->famid;
if (isset($controller->sid)) $pid = $controller->sid;
} else {
$pid = safe_GET_xref('pid', '');
if (empty($pid)) $pid = safe_POST_xref('pid', '');
if (empty($pid)) $pid = safe_GET_xref('rootid', '');
if (empty($pid)) $pid = safe_POST_xref('rootid', '');
if (empty($pid)) $pid = safe_POST_xref('sid', '');
if (empty($pid)) $pid = safe_GET_xref('sid', '');
$famid = safe_GET('famid', WT_REGEX_XREF, '');
if (empty($famid)) $famid = safe_POST('famid', WT_REGEX_XREF, '');
}
echo WT_JS_START; //jQuery code to remove table elements from INDI facts
?>
jQuery(document).ready(function() {
jQuery('#sb_content_extra_info table').replaceWith(function() { return jQuery(this).contents(); });
jQuery('#sb_content_extra_info tbody').replaceWith(function() { return jQuery(this).contents(); });
jQuery('#sb_content_extra_info tr').replaceWith(function() { return jQuery(this).contents(); });
jQuery('#sb_content_extra_info td').replaceWith(function() { return jQuery(this).contents(); });
});
';
foreach ($sidebarmods as $mod) {
if (isset($controller)) $mod->setController($controller);
if ($mod->hasSidebarContent()) {
if ($mod->getName()=="extra_info") {
echo '