/** * Process parameters and display the page. * * @return void * @access public */ public function launch() { global $interface; $interface->assign('openUrlAutoCheck', true); $interface->assign('showSavedLists', true); parent::launch(); }
/** * Process parameters and display the page. * * @return void * @access public */ public function launch() { global $interface; // Build return link back to MetaLib search if (isset($_SERVER['HTTP_REFERER'])) { $parts = parse_url($_SERVER['HTTP_REFERER']); $pathParts = explode('/', $parts['path']); $refAction = array_pop($pathParts); $refModule = array_pop($pathParts); $returnUrl = null; $siteUrl = $interface->get_template_vars('url'); if ($refModule === 'MetaLib') { if ($refAction === 'Home') { // Called from MetaLib/Home: // return to same page and reset previous MetaLib search term. $returnUrl = "{$siteUrl}/MetaLib/Home"; unset($_SESSION['metalibLookfor']); } else { if ($refAction === 'Search') { $fromMetaLibSearch = stripos($_SESSION['lastSearchURL'], '/MetaLib/Search') !== false; if ($fromMetaLibSearch) { // Called from MetaLib/Search: // Set return url to current MetaLib search. $returnUrl = $_SESSION['lastSearchURL']; } else { // Previous search was outside MetaLib: // reset search term and return to MetaLib/Home. $returnUrl = "{$siteUrl}/MetaLib/Home"; unset($_SESSION['metalibLookfor']); } } } } else { if ($refModule == 'Browse' && $refAction === 'Database' && isset($_SESSION['backToMetaLibURL'])) { // Called from Browse/Database: // use stored return url. $returnUrl = $_SESSION['backToMetaLibURL']; } else { // Called outside Browse/Database and MetaLib: // no need to display link back to MetaLib. unset($_SESSION['backToMetaLibURL']); unset($_SESSION['metalibLookfor']); } } if ($returnUrl && $interface->get_template_vars('metalibEnabled')) { $_SESSION['backToMetaLibURL'] = $returnUrl; $interface->assign('backToMetaLib', $returnUrl); $interface->assign('backToMetaLibLabel', translate('Back to MetaLib Search')); } } else { unset($_SESSION['metalibLookfor']); } if (isset($_REQUEST['refLookfor'])) { $_SESSION['metalibLookfor'] = $_REQUEST['refLookfor']; } $metalibSearch = null; if (isset($_SESSION['metalibLookfor']) && $_SESSION['metalibLookfor'] !== '') { $metalibSearch = $this->getBrowseUrl('Search', $_SESSION['metalibLookfor']); } else { $metalibSearch = $this->getBrowseUrl('Home'); } $interface->assign('metalibSearch', $metalibSearch); parent::launch(); }