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