/**
  * {@inheritdoc}
  */
 public function operators()
 {
     $operators = parent::operators();
     // @todo Enable "(not) between" again once that operator is available in
     //   the Search API.
     unset($operators['between'], $operators['not between'], $operators['regular_expression']);
     return $operators;
 }
 /**
  * Do some minor translation of the exposed input
  */
 public function acceptExposedInput($input)
 {
     // We need to add out options to what will be the value array.
     $value =& $input[$this->options['expose']['identifier']];
     $value = ['value' => $value, 'lat' => $input['lat'] ?: $this->value['lat'], 'lng' => $input['lng'] ?: $this->value['lng'], 'units' => $input['units'] ?: $this->value['units']];
     $rc = parent::acceptExposedInput($input);
     return $rc;
 }
Exemple #3
0
 public function acceptExposedInput($input)
 {
     if (empty($this->options['exposed'])) {
         return TRUE;
     }
     // Store this because it will get overwritten.
     $type = $this->value['type'];
     $rc = parent::acceptExposedInput($input);
     // Don't filter if value(s) are empty.
     $operators = $this->operators();
     if (!empty($this->options['expose']['use_operator']) && !empty($this->options['expose']['operator_id'])) {
         $operator = $input[$this->options['expose']['operator_id']];
     } else {
         $operator = $this->operator;
     }
     if ($operators[$operator]['values'] == 1) {
         if ($this->value['value'] == '') {
             return FALSE;
         }
     } else {
         if ($this->value['min'] == '' || $this->value['max'] == '') {
             return FALSE;
         }
     }
     // restore what got overwritten by the parent.
     $this->value['type'] = $type;
     return $rc;
 }