You are here

function geofield_handler_filter::accept_exposed_input in Geofield 7.2

Check to see if input from the exposed filters should change the behavior of this filter.

  • @TODO: This could be more polished.

Overrides views_handler_filter_numeric::accept_exposed_input

File

views/handlers/geofield_handler_filter.inc, line 218
Distance filter implementation.

Class

geofield_handler_filter
@file Distance filter implementation.

Code

function accept_exposed_input($input) {
  if (empty($this->options['expose']['identifier'])) {
    return TRUE;
  }
  if (!(isset($this->options['expose']) && isset($this->options['expose']['identifier']))) {
    return FALSE;
  }
  $input_id = $this->options['expose']['identifier'];
  if (empty($input[$input_id]) || $input[$input_id]['distance'] === '' || $input[$input_id]['origin'] === '') {
    return FALSE;
  }
  $this->value['distance'] = $input[$input_id]['distance'];
  $this->value['unit'] = $input[$input_id]['unit'];
  $this->value['origin'] = $input[$input_id]['origin'];
  return TRUE;
}