You are here

public function BlazyFileFormatterBase::getScopedFormElements in Blazy 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldFormatter/BlazyFileFormatterBase.php \Drupal\blazy\Plugin\Field\FieldFormatter\BlazyFileFormatterBase::getScopedFormElements()

Defines the scope for the form elements.

2 calls to BlazyFileFormatterBase::getScopedFormElements()
BlazyFileFormatter::getScopedFormElements in src/Plugin/Field/FieldFormatter/BlazyFileFormatter.php
Defines the scope for the form elements.
BlazyFileFormatterBase::settingsForm in src/Plugin/Field/FieldFormatter/BlazyFileFormatterBase.php
Returns a form to configure settings for the formatter.
1 method overrides BlazyFileFormatterBase::getScopedFormElements()
BlazyFileFormatter::getScopedFormElements in src/Plugin/Field/FieldFormatter/BlazyFileFormatter.php
Defines the scope for the form elements.

File

src/Plugin/Field/FieldFormatter/BlazyFileFormatterBase.php, line 71

Class

BlazyFileFormatterBase
Base class for blazy/slick image, and file ER formatters.

Namespace

Drupal\blazy\Plugin\Field\FieldFormatter

Code

public function getScopedFormElements() {
  $multiple = $this->fieldDefinition
    ->getFieldStorageDefinition()
    ->isMultiple();
  $captions = [
    'title' => $this
      ->t('Title'),
    'alt' => $this
      ->t('Alt'),
  ];
  return [
    'background' => TRUE,
    'box_captions' => TRUE,
    'captions' => $captions,
    'grid_form' => $multiple,
    'image_style_form' => TRUE,
    'media_switch_form' => TRUE,
    'style' => $multiple,
    'thumbnail_style' => TRUE,
  ] + $this
    ->getCommonScopedFormElements();
}