spaces_handler_filter_spaces_feature.inc in Spaces 6.2
File
includes/spaces_handler_filter_spaces_feature.inc
View source
<?php
class spaces_handler_filter_spaces_feature extends views_handler_filter {
function can_expose() {
return FALSE;
}
function query() {
$contexts = context_active_contexts();
$types = array();
foreach ($contexts as $context) {
if (!empty($context->node)) {
$types = array_merge($types, $context->node);
}
}
$types = drupal_map_assoc($types);
if (!empty($types)) {
$placeholders = db_placeholders($types, 'varchar');
if (!empty($this->relationship)) {
$table = $this->relationship;
}
else {
$table = $this->query
->ensure_table('node');
}
$this->query
->add_where($this->options['group'], "{$table}.type IN ({$placeholders})", $types);
}
}
}