You are here

function apachesolr_views_query::get_url_queryvalues in Apache Solr Views 6

return any query string for use in the l function

See also

l()

File

./apachesolr_views_query.inc, line 708

Class

apachesolr_views_query
Class for handling a view that gets its data not from the database, but from a Solr server.

Code

function get_url_queryvalues() {

  // goes through and finds all the exposed filters
  $query_values = array();
  foreach ($this->_view_filters as $filter) {
    if ($filter->options['exposed']) {
      if ($filter->field == 'text' && !empty($this->_query)) {

        // the search exposed filter is special
        $query_values[$filter->options['expose']['identifier']] = $this->_query;
      }
      elseif ($this->_facets[$filter->field]) {
        $query_values[$filter->options['expose']['identifier']] = $this->_facets[$filter->field];
      }
      elseif (!empty($_GET[$filter->options['expose']['identifier']]) && $filter->field != 'text') {
        $query_values[$filter->options['expose']['identifier']] = $_GET[$filter->options['expose']['identifier']];
      }
    }
  }
  foreach ($this->_extra_query as $field => $value) {
    $query_values[$field] = $value;
  }
  return $query_values;
}