handler_filter_boolean.inc 842 B

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