public function ImageStyleDeleteForm::buildForm

Implements \Drupal\Core\Form\FormInterface::buildForm().

Overrides ConfirmFormBase::buildForm

File

drupal/core/modules/image/lib/Drupal/image/Form/ImageStyleDeleteForm.php, line 63
Contains \Drupal\image\Form\ImageStyleDeleteForm.

Class

ImageStyleDeleteForm
Creates a form to delete an image style.

Namespace

Drupal\image\Form

Code

public function buildForm(array $form, array &$form_state, ImageStyle $image_style = NULL) {
  $this->imageStyle = $image_style;
  $replacement_styles = array_diff_key(image_style_options(), array(
    $this->imageStyle
      ->id() => '',
  ));
  $form['replacement'] = array(
    '#title' => t('Replacement style'),
    '#type' => 'select',
    '#options' => $replacement_styles,
    '#empty_option' => t('No replacement, just delete'),
  );
  return parent::buildForm($form, $form_state);
}