You are here

function svg_image_field_formatter_settings_summary in Svg Image 7

Implements hook_field_formatter_settings_summary().

File

includes/svg_image.field.inc, line 105
Contains hooks and functions related the field settings.

Code

function svg_image_field_formatter_settings_summary($field, $instance, $view_mode) {
  $formatter_settings = $instance['display'][$view_mode]['settings'];
  $original_summary = module_invoke('image', 'field_formatter_settings_summary', $field, $instance, $view_mode);
  $summary = explode('<br />', $original_summary);
  if (!empty($formatter_settings['svg_settings']['width']) || !empty($formatter_settings['svg_settings']['width'])) {
    $summary[] = t('SVG images attributes: <br /> Width: @widthpx,<br /> Height: @heightpx', array(
      '@width' => (int) $formatter_settings['svg_settings']['width'],
      '@height' => (int) $formatter_settings['svg_settings']['height'],
    ));
  }
  return implode('<br />', $summary);
}