You are here

function mediafield_field_formatter_settings_summary in D7 Media 7.4

Same name and namespace in other branches
  1. 7.2 modules/mediafield/mediafield.module \mediafield_field_formatter_settings_summary()
  2. 7.3 modules/mediafield/mediafield.module \mediafield_field_formatter_settings_summary()

Implements hook_field_formatter_settings_summary().

File

modules/mediafield/mediafield.module, line 111
Provide a "Multimedia asset" field.

Code

function mediafield_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;
}