Exemplo n.º 1
0
 public function acceptExposedInput($input)
 {
     // A very special override because the All state for this type of
     // filter could have a default:
     if (empty($this->options['exposed'])) {
         return TRUE;
     }
     // If this is non-multiple and non-required, then this filter will
     // participate, but using the default settings, *if* 'limit is true.
     if (empty($this->options['expose']['multiple']) && empty($this->options['expose']['required']) && !empty($this->options['expose']['limit'])) {
         $identifier = $this->options['expose']['identifier'];
         if ($input[$identifier] == 'All') {
             return TRUE;
         }
     }
     return parent::acceptExposedInput($input);
 }
Exemplo n.º 2
0
 /**
  * Do some minor translation of the exposed input
  */
 public function acceptExposedInput($input)
 {
     if (empty($this->options['exposed'])) {
         return TRUE;
     }
     // rewrite the input value so that it's in the correct format so that
     // the parent gets the right data.
     if (!empty($this->options['expose']['identifier'])) {
         $value =& $input[$this->options['expose']['identifier']];
         if (!is_array($value)) {
             $value = array('value' => $value);
         }
     }
     $rc = parent::acceptExposedInput($input);
     if (empty($this->options['expose']['required'])) {
         // We have to do some of our own checking for non-required filters.
         $info = $this->operators();
         if (!empty($info[$this->operator]['values'])) {
             switch ($info[$this->operator]['values']) {
                 case 1:
                     if ($value['value'] === '') {
                         return FALSE;
                     }
                     break;
                 case 2:
                     if ($value['min'] === '' && $value['max'] === '') {
                         return FALSE;
                     }
                     break;
             }
         }
     }
     return $rc;
 }
Exemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function acceptExposedInput($input)
 {
     if (empty($this->options['exposed'])) {
         return TRUE;
     }
     // The "All" state for this type of filter could have a default value. If
     // this is a non-multiple and non-required option, then this filter will
     // participate, but using the default settings *if* 'limit' is true.
     if (empty($this->options['expose']['multiple']) && empty($this->options['expose']['required']) && !empty($this->options['expose']['limit'])) {
         $identifier = $this->options['expose']['identifier'];
         if ($input[$identifier] == 'All') {
             return TRUE;
         }
     }
     return parent::acceptExposedInput($input);
 }