Révision 5d12d676
Ajouté par Assos Assos il y a environ 6 ans
drupal7/sites/all/modules/views/plugins/views_plugin_exposed_form_input_required.inc | ||
---|---|---|
12 | 12 |
*/ |
13 | 13 |
class views_plugin_exposed_form_input_required extends views_plugin_exposed_form { |
14 | 14 |
|
15 |
function option_definition() { |
|
15 |
/** |
|
16 |
* {@inheritdoc} |
|
17 |
*/ |
|
18 |
public function option_definition() { |
|
16 | 19 |
$options = parent::option_definition(); |
17 | 20 |
|
18 | 21 |
$options['text_input_required'] = array('default' => 'Select any filter and click on Apply to see results', 'translatable' => TRUE); |
... | ... | |
20 | 23 |
return $options; |
21 | 24 |
} |
22 | 25 |
|
23 |
function options_form(&$form, &$form_state) { |
|
26 |
/** |
|
27 |
* {@inheritdoc} |
|
28 |
*/ |
|
29 |
public function options_form(&$form, &$form_state) { |
|
24 | 30 |
parent::options_form($form, $form_state); |
25 | 31 |
|
26 | 32 |
$form['text_input_required'] = array( |
... | ... | |
33 | 39 |
); |
34 | 40 |
} |
35 | 41 |
|
36 |
function options_submit(&$form, &$form_state) { |
|
42 |
/** |
|
43 |
* {@inheritdoc} |
|
44 |
*/ |
|
45 |
public function options_submit(&$form, &$form_state) { |
|
37 | 46 |
$form_state['values']['exposed_form_options']['text_input_required_format'] = $form_state['values']['exposed_form_options']['text_input_required']['format']; |
38 | 47 |
$form_state['values']['exposed_form_options']['text_input_required'] = $form_state['values']['exposed_form_options']['text_input_required']['value']; |
39 | 48 |
parent::options_submit($form, $form_state); |
40 | 49 |
} |
41 | 50 |
|
42 |
function exposed_filter_applied() { |
|
51 |
/** |
|
52 |
* {@inheritdoc} |
|
53 |
*/ |
|
54 |
public function exposed_filter_applied() { |
|
43 | 55 |
static $cache = NULL; |
44 | 56 |
if (!isset($cache)) { |
45 | 57 |
$view = $this->view; |
... | ... | |
60 | 72 |
return $cache; |
61 | 73 |
} |
62 | 74 |
|
63 |
function pre_render($values) { |
|
75 |
/** |
|
76 |
* {@inheritdoc} |
|
77 |
*/ |
|
78 |
public function pre_render($values) { |
|
64 | 79 |
if (!$this->exposed_filter_applied()) { |
65 | 80 |
$options = array( |
66 | 81 |
'id' => 'area', |
... | ... | |
82 | 97 |
} |
83 | 98 |
} |
84 | 99 |
|
85 |
function query() { |
|
100 |
/** |
|
101 |
* {@inheritdoc} |
|
102 |
*/ |
|
103 |
public function query() { |
|
86 | 104 |
if (!$this->exposed_filter_applied()) { |
87 | 105 |
// We return with no query; this will force the empty text. |
88 | 106 |
$this->view->built = TRUE; |
Formats disponibles : Unified diff
Weekly update of contrib modules