function file_info_file_types in D7 Media 7
Returns information about file types from hook_file_type_info().
Parameters
$file_type: (optional) A file type name. If ommitted, all file types will be returned.
Return value
Either a file type description, as provided by hook_file_type_info(), or an array of all existing file types, keyed by file type name.
6 calls to file_info_file_types()
- file_entity_entity_info_alter in file_entity/
file_entity.module - Implements hook_entity_info_alter().
- file_entity_list_types_page in file_entity/
file_entity.admin.inc - Displays the file type admin overview page.
- file_get_type in file_entity/
file_entity.file_api.inc - Determines the file type of a passed in file object.
- file_type_load in file_entity/
file_entity.file_api.inc - Returns an object with file type information, so that %file_type can be used in hook_menu() paths.
- file_view_file in file_entity/
file_entity.file_api.inc - Generate an array for rendering just the file portion of a file entity.
1 string reference to 'file_info_file_types'
- file_info_cache_clear in file_entity/
file_entity.file_api.inc - Clears the file info cache.
File
- file_entity/
file_entity.file_api.inc, line 24 - API extensions of Drupal core's file.inc.
Code
function file_info_file_types($file_type = NULL) {
$info =& drupal_static(__FUNCTION__);
if (!isset($info)) {
$info = module_invoke_all('file_type_info');
drupal_alter('file_type_info', $info);
_file_sort_array_by_weight($info);
}
if (isset($file_type)) {
if (isset($info[$file_type])) {
return $info[$file_type];
}
}
else {
return $info;
}
}