Esempio n. 1
0
 /**
  * Get an array of strings to attach to a base URL in order to reproduce the
  * current search.
  *
  * @access  protected
  * @return  array    Array of URL parameters (key=url_encoded_value format)
  */
 protected function getSearchParams()
 {
     $params = array();
     switch ($this->searchType) {
         // Author Home screen
         case "author":
             if ($this->searchSubType == 'home') {
                 $params[] = "author=" . urlencode($this->searchTerms[0]['lookfor']);
             }
             if ($this->searchSubType == 'search') {
                 $params[] = "lookfor=" . urlencode($this->searchTerms[0]['lookfor']);
             }
             $params[] = "basicSearchType=Author";
             break;
             // New Items or Reserves modules may have a few extra parameters to preserve:
         // New Items or Reserves modules may have a few extra parameters to preserve:
         case "newitem":
         case "reserves":
         case "favorites":
         case "list":
             $preserveParams = array('range', 'department', 'course', 'inst', 'dept', 'tag');
             foreach ($preserveParams as $current) {
                 if (isset($_GET[$current])) {
                     if (is_array($_GET[$current])) {
                         foreach ($_GET[$current] as $value) {
                             $params[] = $current . '[]=' . urlencode($value);
                         }
                     } else {
                         $params[] = $current . '=' . urlencode($_GET[$current]);
                     }
                 }
             }
             break;
             // Basic search -- use default from parent class.
         // Basic search -- use default from parent class.
         default:
             $params = parent::getSearchParams();
             break;
     }
     if (isset($_REQUEST['basicType'])) {
         $params[] = 'basicType=' . $_REQUEST['basicType'];
     } else {
         if (isset($_REQUEST['type'])) {
             $params[] = 'type=' . $_REQUEST['type'];
         }
     }
     return $params;
 }
Esempio n. 2
0
 /**
  * Get an array of strings to attach to a base URL in order to reproduce the
  * current search.
  *
  * @access  protected
  * @return  array    Array of URL parameters (key=url_encoded_value format)
  */
 protected function getSearchParams()
 {
     $params = parent::getSearchParams();
     $params[] = 'genealogyType=' . $_REQUEST['genealogyType'];
     return $params;
 }
Esempio n. 3
0
 /**
  * Get an array of strings to attach to a base URL in order to reproduce the
  * current search.
  *
  * @return array Array of URL parameters (key=url_encoded_value format)
  * @access protected
  */
 protected function getSearchParams()
 {
     $params = array();
     switch ($this->searchType) {
         // Author Home screen
         case "author":
             if ($this->searchSubType == 'home') {
                 // Reverse query manipulation from init() for consistent paging:
                 $term = str_replace('\\"', '"', $this->searchTerms[0]['lookfor']);
                 $params[] = "author=" . urlencode(substr($term, 1, strlen($term) - 2));
             }
             if ($this->searchSubType == 'search') {
                 $params[] = "lookfor=" . urlencode($this->searchTerms[0]['lookfor']);
             }
             break;
             // New Items or Reserves modules may have a few extra parameters to preserve
         // New Items or Reserves modules may have a few extra parameters to preserve
         case "newitem":
         case "reserves":
         case "favorites":
         case "list":
             $preserveParams = array('range', 'department', 'course', 'inst', 'dept', 'tag');
             foreach ($preserveParams as $current) {
                 if (isset($_GET[$current])) {
                     if (is_array($_GET[$current])) {
                         foreach ($_GET[$current] as $value) {
                             $params[] = $current . '[]=' . urlencode($value);
                         }
                     } else {
                         $params[] = $current . '=' . urlencode($_GET[$current]);
                     }
                 }
             }
             break;
             // Basic search -- use default from parent class.
         // Basic search -- use default from parent class.
         default:
             $params = parent::getSearchParams();
             break;
     }
     return $params;
 }