2
// TODOL: query() does not work.
3
class og_views_handler_filter_og_type extends views_handler_filter_node_type {
4
function get_value_options() {
5
if (!isset($this->value_options)) {
6
$this->value_title = t('Group node type');
7
$group_types = og_get_types('group');
8
$types = node_get_types();
9
foreach ($group_types as $group_type) {
10
$options[$group_type] = $types[$group_type]->name;
12
$this->value_options = $options;
16
// This is a copy of views_handler_filter_in_operator::query
17
// We force the table to be 'node' instead of 'og'. There might be cleaner ways to do this.
19
if (empty($this->value)) {
22
$table = $this->query->ensure_table('node');
23
$placeholder = !empty($this->definition['numeric']) ? '%d' : "'%s'";
25
$replace = array_fill(0, sizeof($this->value), $placeholder);
26
$in = ' (' . implode(", ", $replace) . ')';
27
$this->query->add_where($this->options['group'], "$table.$this->real_field " . $this->operator . $in, $this->value);
b'\\ No newline at end of file'