You are here

function video_field_formatter_settings_summary in Video 7

Same name and namespace in other branches
  1. 7.2 video.field.inc \video_field_formatter_settings_summary()

Implements hook_field_formatter_settings_summary().

File

./video.field.inc, line 407
Implement an video field, based on the file module's file field.

Code

function video_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 defines
  // their styles in code.
  if (isset($image_styles[$settings['video_style']])) {
    $summary[] = t('Video thumbnail style: @style', array(
      '@style' => $image_styles[$settings['video_style']],
    ));
  }
  else {
    $summary[] = t('Original video thumbnail');
  }
  $link_types = array(
    'content' => t('Linked to content'),
    'file' => t('Linked to video file'),
  );

  // Display this setting only if image is linked.
  if (isset($link_types[$settings['video_link']])) {
    $summary[] = $link_types[$settings['video_link']];
  }
  return implode('<br />', $summary);
}