You are here

public function ImageAPIOptimizeHookImplementations::form_image_style_edit_form_alter in Image Optimize (or ImageAPI Optimize) 4.x

Same name and namespace in other branches
  1. 8.3 src/ImageAPIOptimizeHookImplementations.php \Drupal\imageapi_optimize\ImageAPIOptimizeHookImplementations::form_image_style_edit_form_alter()
  2. 8.2 src/ImageAPIOptimizeHookImplementations.php \Drupal\imageapi_optimize\ImageAPIOptimizeHookImplementations::form_image_style_edit_form_alter()

Implements hook_form_image_style_edit_form_alter().

File

src/ImageAPIOptimizeHookImplementations.php, line 44

Class

ImageAPIOptimizeHookImplementations
Hook implementations for the Image Optimize module.

Namespace

Drupal\imageapi_optimize

Code

public function form_image_style_edit_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  $entity = $form_state
    ->getFormObject()
    ->getEntity();
  $form['pipeline'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Image Optimize Pipeline'),
    '#options' => imageapi_optimize_pipeline_options(),
    '#default_value' => $entity
      ->getPipeline(),
    '#description' => $this
      ->t('Optionally select an Image Optimization pipeline which will be applied after all effects in this image style.'),
    '#weight' => 10,
  ];
}