handler_filter_boolean.inc 776 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Views filter handler class for handling fulltext fields.
  4. */
  5. class SearchApiViewsHandlerFilterBoolean extends SearchApiViewsHandlerFilter {
  6. /**
  7. * Provide a list of options for the operator form.
  8. */
  9. public function operator_options() {
  10. return array();
  11. }
  12. /**
  13. * Provide a form for setting the filter value.
  14. */
  15. public function value_form(&$form, &$form_state) {
  16. while (is_array($this->value)) {
  17. $this->value = $this->value ? array_shift($this->value) : NULL;
  18. }
  19. $form['value'] = array(
  20. '#type' => 'select',
  21. '#title' => empty($form_state['exposed']) ? t('Value') : '',
  22. '#options' => array(1 => t('True'), 0 => t('False')),
  23. '#default_value' => isset($this->value) ? $this->value : '',
  24. );
  25. }
  26. }