You are here

function file_entity_view_mode_labels in D7 Media 7

Return an array of available view modes for file entities.

2 calls to file_entity_view_mode_labels()
file_entity_field_formatter_settings_form in file_entity/file_entity.field.inc
Implements hook_field_formatter_settings_form().
file_entity_view_mode_label in file_entity/file_entity.module
Return the label for a specific file entity view mode.

File

file_entity/file_entity.module, line 344
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;
}