You are here

function linkimagefield_field_formatter_settings_summary in Link Image Field 7

Implements hook_field_formatter_settings_summary().

File

./linkimagefield.module, line 304
Defines a link image field type.

Code

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

  // 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 image_field_formatter_settings_summary($field, $instance, $view_mode);
}