You are here

function flexslider_fields_field_formatter_settings_summary in Flex Slider 7

Same name and namespace in other branches
  1. 7.2 flexslider_fields/flexslider_fields.module \flexslider_fields_field_formatter_settings_summary()

Implements hook_field_formatter_settings_summary().

Displays the summary of the set options of a flexslider formatted image field

File

flexslider_fields/flexslider_fields.module, line 63
Adds fields integration with FlexSlider

Code

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

  // Load option set
  ctools_include('export');
  if (!empty($settings['flexslider_optionset'])) {
    $o = ctools_export_crud_load('flexslider_optionset', $settings['flexslider_optionset']);
    if ($o !== NULL) {
      $optionset = $o;
    }
  }

  // Build settings summary
  $optionset = isset($optionset) ? $optionset->title : t('Default settings');
  $summary[] = t('Option set: %optionset', array(
    '%optionset' => $optionset,
  ));
  if (isset($settings['flexslider_reference_img_src'])) {
    $summary[] = t('Image field of the referenced node: %field', array(
      '%field' => $settings['flexslider_reference_img_src'],
    ));
  }
  return implode('<br />', $summary);
}