1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Definition of views_handler_filter_node_type.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* Filter by node type.
|
10
|
*
|
11
|
* @ingroup views_filter_handlers
|
12
|
*/
|
13
|
class views_handler_filter_node_type extends views_handler_filter_in_operator {
|
14
|
|
15
|
/**
|
16
|
* {@inheritdoc}
|
17
|
*/
|
18
|
public function get_value_options() {
|
19
|
if (!isset($this->value_options)) {
|
20
|
$this->value_title = t('Content types');
|
21
|
$types = node_type_get_types();
|
22
|
$options = array();
|
23
|
foreach ($types as $type => $info) {
|
24
|
$options[$type] = t($info->name);
|
25
|
}
|
26
|
asort($options);
|
27
|
$this->value_options = $options;
|
28
|
}
|
29
|
}
|
30
|
|
31
|
}
|