You are here

function file_entity_view_mode_labels in File Entity (fieldable files) 7.2

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

Return an array of available view modes for file entities.

3 calls to file_entity_view_mode_labels()
file_entity_field_formatter_settings_form in ./file_entity.field.inc
Implements hook_field_formatter_settings_form().
file_entity_view_mode_label in ./file_entity.module
Return the label for a specific file entity view mode.
views_plugin_row_file_view::options_form in views/views_plugin_row_file_view.inc
Provide a form for setting options.

File

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

Code

function file_entity_view_mode_labels() {
  $labels =& drupal_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;
}