webform_handler_filter_is_draft.inc 610 B

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