You are here

function file_info_formatter_types in File Entity (fieldable files) 7

Same name and namespace in other branches
  1. 7.3 file_entity.file_api.inc \file_info_formatter_types()
  2. 7.2 file_entity.file_api.inc \file_info_formatter_types()

Returns information about file formatters from hook_file_formatter_info().

Parameters

$formatter_type: (optional) A file formatter type name. If ommitted, all file formatter will be returned.

Return value

Either a file formatter description, as provided by hook_file_formatter_info(), or an array of all existing file formatters, keyed by formatter type name.

3 calls to file_info_formatter_types()
file_displays_load in ./file_entity.file_api.inc
Returns an array of {file_display} objects for the file type and view mode.
file_entity_file_display_form in ./file_entity.admin.inc
Form callback; presents file display settings for a given view mode.
file_view_file in ./file_entity.file_api.inc
Generate an array for rendering just the file portion of a file entity.
1 string reference to 'file_info_formatter_types'
file_info_cache_clear in ./file_entity.file_api.inc
Clears the file info cache.

File

./file_entity.file_api.inc, line 75
API extensions of Drupal core's file.inc.

Code

function file_info_formatter_types($formatter_type = NULL) {
  $info =& drupal_static(__FUNCTION__);
  if (!isset($info)) {
    $info = module_invoke_all('file_formatter_info');
    drupal_alter('file_formatter_info', $info);
    uasort($info, '_file_entity_sort_weight_label');
  }
  if ($formatter_type) {
    if (isset($info[$formatter_type])) {
      return $info[$formatter_type];
    }
  }
  else {
    return $info;
  }
}