You are here

public static function ImageCrop::getCropFormProperties in Image Widget Crop 8.2

Same name and namespace in other branches
  1. 8 src/Element/ImageCrop.php \Drupal\image_widget_crop\Element\ImageCrop::getCropFormProperties()

Update crop elements of crop into the form.

Parameters

array $original_properties: All properties calculate for apply to.

bool $edit: Context of this form.

Return value

array|null Populate all crop elements into the form.

1 call to ImageCrop::getCropFormProperties()
ImageCrop::getCropFormElement in src/Element/ImageCrop.php
Inject crop elements into the form.

File

src/Element/ImageCrop.php, line 347

Class

ImageCrop
Provides a form element for crop.

Namespace

Drupal\image_widget_crop\Element

Code

public static function getCropFormProperties(array $original_properties, $edit) {
  $crop_elements = self::setCoordinatesElement();
  if (!empty($original_properties) && $edit) {
    foreach ($crop_elements as $properties => $value) {
      $crop_elements[$properties]['value'] = $original_properties[$properties];
    }
  }
  return $crop_elements;
}