You are here

views_handler_filter_upload_fid.inc in Views (for Drupal 7) 6.3

Same filename and directory in other branches
  1. 6.2 modules/upload/views_handler_filter_upload_fid.inc

File

modules/upload/views_handler_filter_upload_fid.inc
View source
<?php

/**
 * Filter by whether or not a node has attached files from the upload module
 */
class views_handler_filter_upload_fid extends views_handler_filter_boolean_operator {
  function construct() {
    parent::construct();
    $this->value_value = t('Has attached files');
  }
  function query() {
    $this
      ->ensure_my_table();
    $this->query
      ->add_where($this->options['group'], "(SELECT COUNT(*) FROM {upload} u WHERE u.vid = {$this->table_alias}.{$this->real_field}) " . (empty($this->value) ? '=' : '<>') . " 0");
  }

}

Classes

Namesort descending Description
views_handler_filter_upload_fid Filter by whether or not a node has attached files from the upload module