You are here

function file_entity_type_get_name in File Entity (fieldable files) 7.2

Same name and namespace in other branches
  1. 7.3 file_entity.module \file_entity_type_get_name()

Returns the file type name of the passed file or file type string.

Parameters

$file: A file object or string that indicates the file type to return.

Return value

The file type name or FALSE if the file type is not found.

6 calls to file_entity_type_get_name()
file_entity_add_upload_submit in ./file_entity.pages.inc
Submit handler for the add file form.
file_entity_delete_form_submit in ./file_entity.pages.inc
Form submission handler for file_entity_delete_form().
file_entity_edit_submit in ./file_entity.pages.inc
Form submission handler for the 'Save' button for file_entity_edit().
file_entity_get_filetype_candidates in ./file_entity.pages.inc
Get the candidate filetypes for a given file.
views_handler_argument_file_type::file_type in views/views_handler_argument_file_type.inc
Helper function to return the human-readable type of the file.

... See full list

1 string reference to 'file_entity_type_get_name'
file_entity_menu in ./file_entity.module
Implements hook_menu().

File

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

Code

function file_entity_type_get_name($file) {
  $type = is_object($file) ? $file->type : $file;
  $info = entity_get_info('file');
  return isset($info['bundles'][$type]['label']) ? $info['bundles'][$type]['label'] : FALSE;
}