public function ImageCropWidget::getSetting in Lightning Media 8
Same name and namespace in other branches
- 8.4 modules/lightning_media_image/src/Plugin/Field/FieldWidget/ImageCropWidget.php \Drupal\lightning_media_image\Plugin\Field\FieldWidget\ImageCropWidget::getSetting()
- 8.2 modules/lightning_media_image/src/Plugin/Field/FieldWidget/ImageCropWidget.php \Drupal\lightning_media_image\Plugin\Field\FieldWidget\ImageCropWidget::getSetting()
- 8.3 modules/lightning_media_image/src/Plugin/Field/FieldWidget/ImageCropWidget.php \Drupal\lightning_media_image\Plugin\Field\FieldWidget\ImageCropWidget::getSetting()
File
- modules/
lightning_media_image/ src/ Plugin/ Field/ FieldWidget/ ImageCropWidget.php, line 42
Class
Namespace
Drupal\lightning_media_image\Plugin\Field\FieldWidgetCode
public function getSetting($key) {
$value = parent::getSetting($key);
// If no crop types are chosen, allow all of them.
if ($key == 'crop_list' && empty($value)) {
$value = CropType::getCropTypeNames();
$value = $this->imageWidgetCropManager
->getAvailableCropType($value);
$value = array_keys($value);
}
return $value;
}