summaryrefslogtreecommitdiff
path: root/sites/all/modules/file_entity/views/views_handler_filter_file_type.inc
blob: 6bca816cf58a5e15f6e15cf60d532ed5bc51ef3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php

/**
 * @file
 * Definition of views_handler_filter_file_type.
 */

/**
 * Filter by file type
 */
class views_handler_filter_file_type extends views_handler_filter_in_operator {
  function get_value_options() {
    if (!isset($this->value_options)) {
      $this->value_title = t('File types');
      $options = array();
      foreach (file_entity_type_get_names() as $type => $name) {
        $options[$type] = t($name);
      }
      asort($options);
      $this->value_options = $options;
    }
  }
}