You are here

function imagezoom_field_formatter_settings_summary in Image Zoom 7.2

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

Implements hook_field_formatter_settings_summary().

1 call to imagezoom_field_formatter_settings_summary()
imagezoom_gallery_field_formatter_settings_summary in modules/imagezoom_gallery/imagezoom_gallery.module
Implements hook_field_formatter_settings_summary().

File

./imagezoom.module, line 145
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();
  $zoom_types = imagezoom_zoom_types();
  $summary[] = t('Zoom type: @type', array(
    '@type' => $zoom_types[$settings['imagezoom_zoom_type']],
  ));
  $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',
  ));
  return implode('<br />', $summary);
}