You are here

public function SlickFileFormatter::getScopedFormElements in Slick Carousel 7.3

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldFormatter/SlickFileFormatter.php \Drupal\slick\Plugin\Field\FieldFormatter\SlickFileFormatter::getScopedFormElements()
  2. 8 src/Plugin/Field/FieldFormatter/SlickFileFormatter.php \Drupal\slick\Plugin\Field\FieldFormatter\SlickFileFormatter::getScopedFormElements()

Defines the scope for the form elements.

Overrides SlickFormatterBase::getScopedFormElements

File

src/Plugin/Field/FieldFormatter/SlickFileFormatter.php, line 183

Class

SlickFileFormatter
Plugin implementation of the 'Slick File' formatter for Media integration.

Namespace

Drupal\slick\Plugin\Field\FieldFormatter

Code

public function getScopedFormElements() {
  $bundles = $this->fieldDefinition['bundles'];
  $strings = [
    'text',
    'list_text',
  ];
  $strings = $this
    ->admin()
    ->getFieldOptions($this->fieldInstance, $strings, $this->targetType, $bundles);
  $texts = [
    'text',
    'text_long',
    'text_with_summary',
    'link_field',
    'url',
  ];
  $texts = $this
    ->admin()
    ->getFieldOptions($this->fieldInstance, $texts, $this->targetType, $bundles);
  $links = [
    'text',
    'link_field',
    'url',
  ];
  $links = $this
    ->admin()
    ->getFieldOptions($this->fieldInstance, $links, $this->targetType, $bundles);
  return [
    'captions' => $this
      ->admin()
      ->getFieldOptions($this->fieldInstance, [], $this->targetType, $bundles),
    'images' => $this
      ->admin()
      ->getFieldOptions($this->fieldInstance, [
      'image',
    ], $this->targetType, $bundles),
    'multimedia' => TRUE,
    'classes' => $strings,
    'layouts' => $strings,
    'links' => $links,
    'titles' => $texts,
    'thumb_captions' => $texts,
    'use_view_mode' => TRUE,
    'vanilla' => TRUE,
  ] + parent::getScopedFormElements();
}