You are here

function juicebox_field_formatter_settings_summary in Juicebox HTML5 Responsive Image Galleries 7

Same name and namespace in other branches
  1. 7.2 includes/juicebox.field.inc \juicebox_field_formatter_settings_summary()

Implements hook_field_formatter_settings_summary().

File

./juicebox.module, line 1035
Provides Drupal integration with the Juicebox library.

Code

function juicebox_field_formatter_settings_summary($field, $instance, $view_mode) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $settings_display = array();

  // Image style setting.
  if (!empty($settings['image_style'])) {
    $style = $settings['image_style'];
  }
  else {
    $style = t('Original Image');
  }
  $settings_display[] = t("Image style: @style", array(
    '@style' => $style,
  ));

  // Thumb style setting.
  if (!empty($settings['thumb_style'])) {
    $style = $settings['thumb_style'];
  }
  else {
    $style = t('Original Image');
  }
  $settings_display[] = t("Thumbnail style: @style", array(
    '@style' => $style,
  ));

  // Define display options for caption and title source.
  $options = array(
    'alt' => t('Alternate text'),
    'title' => t('Title'),
  );

  // Caption source setting.
  if (!empty($settings['caption_source'])) {
    $source = $options[$settings['caption_source']];
  }
  else {
    $source = t('None');
  }
  $settings_display[] = t("Caption source: @source", array(
    '@source' => $source,
  ));

  // Title source setting.
  if (!empty($settings['title_source'])) {
    $source = $options[$settings['title_source']];
  }
  else {
    $source = t('None');
  }
  $settings_display[] = t("Title source: @source", array(
    '@source' => $source,
  ));

  // Add-in a note about the additional fieldsets.
  $settings_display[] = t("Additional Juicebox library configuration options may also be set.");
  $summary = implode('<br />', $settings_display);
  return $summary;
}