public function ImageCropWidget::settingsForm in Lightning Media 8.4
Same name and namespace in other branches
- 8 modules/lightning_media_image/src/Plugin/Field/FieldWidget/ImageCropWidget.php \Drupal\lightning_media_image\Plugin\Field\FieldWidget\ImageCropWidget::settingsForm()
- 8.2 modules/lightning_media_image/src/Plugin/Field/FieldWidget/ImageCropWidget.php \Drupal\lightning_media_image\Plugin\Field\FieldWidget\ImageCropWidget::settingsForm()
- 8.3 modules/lightning_media_image/src/Plugin/Field/FieldWidget/ImageCropWidget.php \Drupal\lightning_media_image\Plugin\Field\FieldWidget\ImageCropWidget::settingsForm()
File
- modules/
lightning_media_image/ src/ Plugin/ Field/ FieldWidget/ ImageCropWidget.php, line 28
Class
- ImageCropWidget
- Adds functionality to the image crop field widget.
Namespace
Drupal\lightning_media_image\Plugin\Field\FieldWidgetCode
public function settingsForm(array $form, FormStateInterface $form_state) {
$element = parent::settingsForm($form, $form_state);
$variables = [
'@crop_types' => Url::fromRoute('crop.overview_types')
->toString(),
'@image_styles' => Url::fromRoute('entity.image_style.collection')
->toString(),
];
$element['crop_list']['#description'] = $this
->t('The <a href="@crop_types">crop types</a> to allow. Only crop types that are associated with at least one <a href="@image_styles">image style</a> are shown here. If none are selected, all will be allowed.', $variables);
$element['crop_list']['#required'] = FALSE;
return $element;
}