1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Definition of views_handler_filter_field_list.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* Filter handler which uses list-fields as options.
|
10
|
*
|
11
|
* @ingroup views_filter_handlers
|
12
|
*/
|
13
|
class views_handler_filter_field_list extends views_handler_filter_many_to_one {
|
14
|
|
15
|
/**
|
16
|
* {@inheritdoc}
|
17
|
*/
|
18
|
public function init(&$view, &$options) {
|
19
|
parent::init($view, $options);
|
20
|
// Migrate the settings from the old filter_in_operator values to
|
21
|
// filter_many_to_one.
|
22
|
if ($this->options['operator'] == 'in') {
|
23
|
$this->options['operator'] = 'or';
|
24
|
}
|
25
|
if ($this->options['operator'] == 'not in') {
|
26
|
$this->options['operator'] = 'not';
|
27
|
}
|
28
|
$this->operator = $this->options['operator'];
|
29
|
}
|
30
|
|
31
|
/**
|
32
|
* {@inheritdoc}
|
33
|
*/
|
34
|
public function get_value_options() {
|
35
|
$field = field_info_field($this->definition['field_name']);
|
36
|
$this->value_options = list_allowed_values($field);
|
37
|
}
|
38
|
|
39
|
}
|