You are here

function media_field_formatter_settings_summary in D7 Media 7

Same name and namespace in other branches
  1. 7.4 includes/media.fields.inc \media_field_formatter_settings_summary()
  2. 7.2 includes/media.fields.inc \media_field_formatter_settings_summary()
  3. 7.3 includes/media.fields.inc \media_field_formatter_settings_summary()

Implements hook_field_formatter_settings_summary().

File

includes/media.fields.inc, line 130
: Provides a "Multimedia asset" field to the fields API

Code

function media_field_formatter_settings_summary($field, $instance, $view_mode) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $summary = '';
  if ($display['type'] == 'media') {
    $entity_info = entity_get_info('file');
    $file_view_mode_label = isset($entity_info['view modes'][$settings['file_view_mode']]) ? $entity_info['view modes'][$settings['file_view_mode']]['label'] : t('Default');
    $summary = t('File view mode: @view_mode', array(
      '@view_mode' => $file_view_mode_label,
    ));
  }
  return $summary;
}