You are here

function file_type_get_names in File Entity (fieldable files) 7

Returns a list of available file type names.

Return value

An array of file type names, keyed by the type.

1 call to file_type_get_names()
views_handler_filter_file_type::get_value_options in views/views_handler_filter_file_type.inc
Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.

File

./file_entity.module, line 618
Extends Drupal file entities to be fieldable and viewable.

Code

function file_type_get_names() {
  $names =& drupal_static(__FUNCTION__);
  if (!isset($names)) {
    $info = entity_get_info('file');
    foreach ($info['bundles'] as $bundle => $bundle_info) {
      $names[$bundle] = $bundle_info['label'];
    }
  }
  return $names;
}