You are here

function file_entity_type_get_names in File Entity (fieldable files) 8.2

Same name and namespace in other branches
  1. 7.3 file_entity.module \file_entity_type_get_names()
  2. 7.2 file_entity.module \file_entity_type_get_names()

Returns a list of available file type names.

Return value

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

1 call to file_entity_type_get_names()
file_entity_admin_menu_map in ./file_entity.module
Implements hook_admin_menu_map().

File

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

Code

function file_entity_type_get_names() {
  $names =& drupal_static(__FUNCTION__);
  if (!isset($names)) {
    foreach (FileType::loadMultiple() as $id => $type) {
      $names[$id] = $type
        ->label();
    }
  }
  return $names;
}