You are here

function media_field_formatter_settings_summary in D7 Media 7.4

Same name and namespace in other branches
  1. 7 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().

Legacy support for the "Large filetype icon" file field formatter.

See also

media_field_formatter_info()

File

includes/media.fields.inc, line 708
Provide media selector widget and media field formatters to the fields API.

Code

function media_field_formatter_settings_summary($field, $instance, $view_mode) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $summary = array();
  $image_styles = image_style_options(FALSE, PASS_THROUGH);

  // Unset possible 'No defined styles' option.
  unset($image_styles['']);

  // Styles could be lost because of enabled/disabled modules that defines
  // their styles in code.
  if (isset($image_styles[$settings['image_style']])) {
    $summary[] = t('Image style: @style', array(
      '@style' => $image_styles[$settings['image_style']],
    ));
  }
  else {
    $summary[] = t('Original image');
  }
  return implode('<br />', $summary);
}