1 file.module file_view_mode_labels()

Return an array of available view modes for file entities.

File

core/modules/file/file.module, line 2370
Defines a "managed_file" Form API field and a "file" field for Field module.

Code

function file_view_mode_labels() {
  $labels = &backdrop_static(__FUNCTION__);

  if (!isset($options)) {
    $entity_info = entity_get_info('file');
    $labels = array('default' => t('Default'));
    foreach ($entity_info['view modes'] as $machine_name => $mode) {
      $labels[$machine_name] = $mode['label'];
    }
  }

  return $labels;
}