public function SlickParagraphsFormatter::getScopedFormElements in Slick Paragraphs 8.2
Same name and namespace in other branches
- 8 src/Plugin/Field/FieldFormatter/SlickParagraphsFormatter.php \Drupal\slick_paragraphs\Plugin\Field\FieldFormatter\SlickParagraphsFormatter::getScopedFormElements()
Overrides the scope for the form elements.
Overrides SlickMediaFormatter::getScopedFormElements
File
- src/
Plugin/ Field/ FieldFormatter/ SlickParagraphsFormatter.php, line 28
Class
- SlickParagraphsFormatter
- Plugin implementation of the 'Slick Paragraphs Media' formatter.
Namespace
Drupal\slick_paragraphs\Plugin\Field\FieldFormatterCode
public function getScopedFormElements() {
$admin = $this
->admin();
$target_type = $this
->getFieldSetting('target_type');
$views_ui = $this
->getFieldSetting('handler') == 'default';
$bundles = $views_ui ? [] : $this
->getFieldSetting('handler_settings')['target_bundles'];
$media = $admin
->getFieldOptions($bundles, [
'entity_reference',
], $target_type, 'media');
$stages = $admin
->getFieldOptions($bundles, [
'image',
'entity_reference',
], $target_type);
return [
'images' => $stages,
'overlays' => $stages + $media,
] + parent::getScopedFormElements();
}