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