public function indexAction() { $response = parent::indexAction(); // set view template $response->setView('summon/index.xsl'); return $response; }
public function indexAction() { $data = parent::indexAction(); // set view template $data->setTemplate('summon/index.xsl'); return $data; }
protected function currentParams() { // unset query for username $params = parent::currentParams(); $params["username"] = $params["query"]; unset($params["query"]); return $params; }
public function recordAction() { $model = parent::recordAction(); // flash message $flashMessenger = $this->flashMessenger(); if ($flashMessenger->hasMessages()) { $message = $flashMessenger->getMessages(); $model->setVariable('flash_message', $message[0]); } return $model; }
/** * (non-PHPdoc) * @see Application\Controller.SearchController::recordAction() */ public function recordAction() { $response = parent::recordAction(); $results = $this->response->getVariable('results'); $result = $results->getRecord(0); // special display for solr if ($result->getXerxesRecord() instanceof Solr\Record) { $response->setView('folder/books/record.xsl'); $response->setVariable('folder_config', Solr\Config::getInstance()); } return $response; }
/** * This is called by searchAction once the search has been initiated and * again by javascript via ajaxstatusAction once the search has ended * Uses parent (SearchController) resultsAction */ public function resultsAction() { //Debug::dump($this->query); $sid = $_SESSION[$this->id]['sid']; try { $status = $this->engine->getSearchStatus($sid); } catch (\Exception $e) { // Exception probably a session timeout; go back to front page $fm = new FlashMessenger(); $fm->addMessage('Session timeout: ' . $e->getMessage()); $params = $this->query->getAllSearchParams(); $params['lang'] = $this->request->getParam('lang'); $params['controller'] = $this->request->getParam('controller'); $params['action'] = 'index'; $url = $this->request->url_for($params); return $this->redirect()->toUrl($url); } // keep the session number for the AJAX code in the output HTML $this->request->setSessionData('pz2session', $sid); // tell jquery whether to start the timer $this->request->setSessionData('completed', (string) $status->isFinished()); $this->request->setSessionData('targetnames', $this->query->getTargetNames()); //Debug::dump($this->request); exit; // do the same with the query string $params = $this->query->getAllSearchParams(); $pairs = array(); foreach ($params as $k => $v) { if (is_array($v)) { foreach ($v as $e) { $pairs[] = "{$k}={$e}"; } } else { $pairs[] = "{$k}={$v}"; } } $query_string = implode('&', $pairs); // needed for the javascript redirect $this->request->setSessionData('querystring', $query_string); $this->query->fillTargetInfo(); if ($status->isFinished()) { $result = parent::resultsAction(); } else { $result = array(); } $result['status'] = $status->getTargetStatuses($this->query->getTargets()); $result['externalLinks'] = $this->helper->addExternalLinks($this->config); return $result; }
/** * ResultsAction is called by statusAction once the search has completed * Uses parent (SearchController) resultsAction */ public function resultsAction() { //var_dump($this->request); exit; $uo = new UserOptions($this->request); $sid = $uo->getSessionData('pz2session'); try { // force restoration of client from cache $status = $this->engine->getSearchStatus($sid); // fetch the search results $result = parent::resultsAction(); } catch (\Exception $e) { // Exception probably a session timeout; go back to front page $this->flashMessenger->addMessage('Error|Session timeout: ' . $e->getMessage()); $params = $this->query->getAllSearchParams(); $params['controller'] = 'pazpar2'; $params['action'] = 'index'; $params['Submit'] = ''; $url = $this->request->url_for($params); return $this->redirect()->toUrl($url); } // keep the session number for the AJAX code in the output HTML $this->request->setSessionData('pz2session', $sid); $targets = $uo->getSessionData('targets'); $type = $uo->getSessionData('source_type'); $targets = new Targets($type, $targets); $result->setVariable('useroptions', $uo); $result->setVariable('targets', $targets->getTargetNames()); // needed for the facets //$result['status'] = $status->getTargetStatuses($this->query->getTargets()); //$result['externalLinks'] = $this->helper->addExternalLinks($this->config); return $result; }
/** * Records that are in this reading list */ public function resultsAction() { if ($this->readinglist()->hasRecords()) { return parent::resultsAction(); } }
protected function init() { parent::init(); $this->helper = new SearchHelper($this->event, $this->id, $this->engine); }
protected function init(MvcEvent $e) { parent::init($e); $this->helper = new SearchHelper($e, $this->id, $this->engine); }
/** * ResultsAction is called by statusAction once the search has completed * Uses parent (SearchController) resultsAction */ public function resultsAction() { $uo = new UserOptions($this->request); $sid = $uo->getSessionData('pz2session'); try { // force restoration of client from cache $status = $this->engine->getSearchStatus($sid); // fetch the search results $result = parent::resultsAction(); } catch (\Exception $e) { // Exception probably a session timeout; go back to front page $this->flashMessenger->addMessage('Error|Session timeout: ' . $e->getMessage()); $params = $this->query->getAllSearchParams(); $params['controller'] = 'pazpar2'; $params['action'] = 'index'; $params['Submit'] = ''; $url = $this->request->url_for($params); return $this->redirect()->toUrl($url); } // keep the session number for the AJAX code in the output HTML $this->request->setSessionData('pz2session', $sid); $params = $this->query->getAllSearchParams(); $pairs = array(); foreach ($params as $k => $v) { if (is_array($v)) { foreach ($v as $e) { $pairs[] = "{$k}={$e}"; } } else { $pairs[] = "{$k}={$v}"; } } $query_string = implode('&', $pairs); // needed by javascript (currently only for aim25) $this->request->setSessionData('querystring', $query_string); $targets = $uo->getSessionData('targets'); $type = $uo->getSessionData('source_type'); $targets = new Targets($type, $targets); $result->setVariable('externalLinks', $this->helper->addExternalLinks($this->config)); $result->setVariable('useroptions', $uo); $result->setVariable('targets', $targets->getTargetNames()); // needed for the facets //$result['status'] = $status->getTargetStatuses($this->query->getTargets()); //$result['externalLinks'] = $this->helper->addExternalLinks($this->config); return $result; }