You are here

function imagezoom_field_formatter_settings_summary in Image Zoom 7

Same name and namespace in other branches
  1. 7.2 imagezoom.module \imagezoom_field_formatter_settings_summary()

Implements hook_field_formatter_settings_summary().

File

./imagezoom.module, line 88
Provides an Image Zoom field formatter for Image fields.

Code

function imagezoom_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 define
  // their styles in code.
  $summary[] = t('Display image style: @style', array(
    '@style' => isset($image_styles[$settings['imagezoom_display_style']]) ? $image_styles[$settings['imagezoom_display_style']] : 'original',
  ));
  $summary[] = t('Zoomed image style: @style', array(
    '@style' => isset($image_styles[$settings['imagezoom_zoom_style']]) ? $image_styles[$settings['imagezoom_zoom_style']] : 'original',
  ));
  if (variable_get('imagezoom_multiple_thumbs', 0)) {
    $summary[] = t('Thumbnail image style: @style', array(
      '@style' => isset($image_styles[$settings['imagezoom_thumb_style']]) ? $image_styles[$settings['imagezoom_thumb_style']] : 'original',
    ));
  }
  return implode('<br />', $summary);
}