Exemplo n.º 1
0
 /**
  * Internal utility function for initializing
  * UrlQueryHelper for a Results-object with search ids for all tabs.
  *
  * @param ResultsManager $results Search results.
  * @param ServiceManager $locator Service locator.
  *
  * @return Results Search results with initialized UrlQueryHelper
  */
 public static function initUrlQueryHelper(\VuFind\Search\Base\Results $results, $locator)
 {
     if (Console::isConsole()) {
         return $results;
     }
     $helper = new UrlQueryHelper($results->getParams());
     $savedSearches = $locator->get('Request')->getQuery('search');
     if ($savedSearches) {
         $helper->setDefaultParameter('search', $savedSearches);
     }
     $results->setHelper('urlQuery', $helper);
     return $results;
 }
Exemplo n.º 2
0
 /**
  * Internal utility function for initializing
  * UrlQueryHelper for a Results-object with search ids for all tabs.
  *
  * @param ResultsManager $results Search results.
  * @param ServiceManager $sm      Service manager.
  *
  * @return Results Search results with initialized UrlQueryHelper
  */
 public static function initUrlQueryHelper(\VuFind\Search\Base\Results $results, $sm)
 {
     $helper = new UrlQueryHelper($results->getParams());
     $savedSearches = $sm->getServiceLocator()->get('Request')->getQuery('search');
     if ($savedSearches) {
         $helper->setDefaultParameter('search', $savedSearches);
     }
     $results->setHelper('urlQuery', $helper);
     return $results;
 }