webform_handler_filter_is_draft.inc 641 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * Views handler to filter submissions by draft state.
  4. *
  5. * Filter by submission status.
  6. */
  7. class webform_handler_filter_is_draft extends views_handler_filter_in_operator {
  8. /**
  9. *
  10. */
  11. public function get_value_options() {
  12. if (!isset($this->value_options)) {
  13. $this->value_title = t('Status');
  14. $options = array('0' => t('Completed'), '1' => t('Draft'));
  15. $this->value_options = $options;
  16. }
  17. }
  18. /**
  19. * '0' won't work as a key for checkboxes.
  20. */
  21. public function value_form(&$form, &$form_state) {
  22. parent::value_form($form, $form_state);
  23. $form['value']['#type'] = 'select';
  24. }
  25. }