function auto_image_style_field_formatter_settings_summary in Auto image style 7
Implements hook_field_formatter_settings_summary().
File
- ./
auto_image_style.module, line 144
Code
function auto_image_style_field_formatter_settings_summary($field, $instance, $view_mode) {
$display = $instance['display'][$view_mode];
$settings = $display['settings'];
$summary = array();
$summary[] = t('Image style for portrait: @value', array(
'@value' => $settings['image_style_portrait'],
));
$summary[] = t('Image style for landscape: @value', array(
'@value' => $settings['image_style_landscape'],
));
$link_types = array(
'content' => t('content'),
'file' => t('file'),
);
if (module_exists('link')) {
$link_types = array_merge($link_types, auto_image_style_get_link_fields($instance));
}
if ($settings['image_style_configure_css']) {
$summary[] = t('CSS class for portrait: @value', array(
'@value' => $settings['image_style_portrait_class'],
));
$summary[] = t('CSS class for landscape: @value', array(
'@value' => $settings['image_style_landscape_class'],
));
}
// Display this setting only if image is linked.
if (isset($link_types[$settings['image_link']])) {
$summary[] = t('Linked to @type', array(
'@type' => $link_types[$settings['image_link']],
));
}
return implode('<br />', $summary);
}