public function ImageStyleDeleteForm::submitForm

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

array $form_state: An associative array containing the current state of the form.

Overrides FormInterface::submitForm

File

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

Class

ImageStyleDeleteForm
Creates a form to delete an image style.

Namespace

Drupal\image\Form

Code

public function submitForm(array &$form, array &$form_state) {
  $this->imageStyle
    ->set('replacementID', $form_state['values']['replacement']);
  $this->imageStyle
    ->delete();
  drupal_set_message(t('Style %name was deleted.', array(
    '%name' => $this->imageStyle
      ->label(),
  )));
  $form_state['redirect'] = 'admin/config/media/image-styles';
}