function video_embed_field_field_formatter_settings_summary in Video Embed Field 7.2
Implements hook_field_formatter_settings_summary().
File
- ./
video_embed_field.field.inc, line 399 - Implement a video field.
Code
function video_embed_field_field_formatter_settings_summary($field, $instance, $view_mode) {
$display = $instance['display'][$view_mode];
$settings = $display['settings'];
$summary = array();
if ($display['type'] == 'video_embed_field' || $display['type'] == 'video_embed_field_thumbnail_colorbox' || $display['type'] == 'video_embed_field_url_colorbox') {
$video_styles = video_embed_field_video_style_options(FALSE);
// Styles could be lost because of enabled/disabled modules that defines
// their styles in code.
if (isset($video_styles[$settings['video_style']])) {
$summary[] = t('Video style: @style', array(
'@style' => $video_styles[$settings['video_style']],
));
}
}
if ($display['type'] == 'video_embed_field_thumbnail' || $display['type'] == 'video_embed_field_thumbnail_colorbox') {
$image_styles = image_style_options(FALSE);
if (isset($image_styles[$settings['image_style']])) {
$summary[] = t('Image style: @style', array(
'@style' => $image_styles[$settings['image_style']],
));
}
else {
$summary[] = t('Original Image.');
}
if (isset($settings['image_link'])) {
$summary[] = t('Image link: @image_link', array(
'@image_link' => $settings['image_link'],
));
}
else {
$summary[] = t('Image link: none');
}
}
if (isset($settings['description'])) {
if ($settings['description'] && $instance['settings']['description_field']) {
$summary[] = t('Show description');
}
elseif ($instance['settings']['description_field']) {
$summary[] = t('Hide description');
}
}
return implode('<br />', $summary);
}