public function ajaxRequest() { global $SEARCH_SPIDER; // Search engines should not make AJAX requests if ($SEARCH_SPIDER) { header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden'); exit; } // Initialise tabs $tab = WT_Filter::get('module'); // A request for a non-existant tab? if (array_key_exists($tab, $this->tabs)) { $mod = $this->tabs[$tab]; } else { header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found'); exit; } header("Content-Type: text/html; charset=UTF-8"); // AJAX calls do not have the meta tag headers and need this set header("X-Robots-Tag: noindex,follow"); // AJAX pages should not show up in search results, any links can be followed though Zend_Session::writeClose(); echo $mod->getTabContent(); if (WT_DEBUG_SQL) { echo WT_DB::getQueryLog(); } }
$module_name = $blocks['main'][$block_id]; } elseif (array_key_exists($block_id, $blocks['side'])) { $module_name = $blocks['side'][$block_id]; } else { exit; } if (array_key_exists($module_name, $all_blocks)) { $class_name = $module_name . '_WT_Module'; $module = new $class_name(); $module->getBlock($block_id); } if (WT_DEBUG) { echo execution_stats(); } if (WT_DEBUG_SQL) { echo WT_DB::getQueryLog(); } exit; } $controller = new WT_Controller_Page(); if ($ctype == 'user') { $controller->restrictAccess(Auth::isMember()); } $controller->setPageTitle($ctype == 'user' ? WT_I18N::translate('My page') : WT_TREE_TITLE)->setMetaRobots('index,follow')->setCanonicalUrl(WT_SCRIPT_NAME . '?ctype=' . $ctype . '&ged=' . WT_GEDCOM)->pageHeader()->addInlineJavascript('jQuery.ajaxSetup({cache:true});'); if ($ctype == 'user') { echo '<div id="my-page">'; echo '<h1 class="center">', WT_I18N::translate('My page'), '</h1>'; } else { echo '<div id="home-page">'; } if ($blocks['main']) {
protected function pageFooter() { global $footerfile, $TEXT_DIRECTION, $view; if (WT_GED_ID) { require WT_ROOT . $footerfile; } if (WT_DEBUG_SQL) { echo WT_DB::getQueryLog(); } echo $this->getJavascript(); echo '</body></html>'; return $this; }
protected function pageFooter() { if (WT_DEBUG_SQL) { echo WT_DB::getQueryLog(); } echo $this->getJavascript(); }