You are here

public function FieldSlideshow::settingsSummary in Field Slideshow 8.3

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldFormatter/FieldSlideshow.php \Drupal\field_slideshow\Plugin\Field\FieldFormatter\FieldSlideshow::settingsSummary()
  2. 8.2 src/Plugin/Field/FieldFormatter/FieldSlideshow.php \Drupal\field_slideshow\Plugin\Field\FieldFormatter\FieldSlideshow::settingsSummary()

Settings summary.

Return value

array|string[] Summary array.

Overrides ImageFormatter::settingsSummary

File

src/Plugin/Field/FieldFormatter/FieldSlideshow.php, line 182

Class

FieldSlideshow
Plugin implementation of the 'slideshow' formatter.

Namespace

Drupal\field_slideshow\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  $image_styles = image_style_options(FALSE);
  $slideshow = array_filter($this
    ->getSetting('slideshow'));
  $pager = array_filter($this
    ->getSetting('slideshow_pager'));
  $colorbox = $this
    ->getSetting('colorbox_image_style');
  $colorbox_link = $this
    ->getSetting('image_link');
  if ($colorbox && $colorbox_link == 'colorbox') {
    $summary[] = 'Colorbox: ' . $image_styles[$colorbox];
  }
  foreach ($slideshow as $key => $value) {
    if ($value == 1) {
      $value = 'TRUE';
    }
    $summary[] = ucfirst($key) . ': ' . $value;
  }
  if (isset($pager['pager']) && array_filter($pager['pager'])) {
    $summary[] = 'Pager:' . implode(',', array_filter($pager['pager']));
  }
  if (isset($pager['controls'])) {
    $summary[] = 'Controls';
  }
  return $summary;
}