/**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     $form_state->cleanValues();
     // The image effect configuration is stored in the 'data' key in the form,
     // pass that through for submission.
     $this->imageEffect->submitConfigurationForm($form['data'], SubformState::createForSubform($form['data'], $form, $form_state));
     $this->imageEffect->setWeight($form_state->getValue('weight'));
     if (!$this->imageEffect->getUuid()) {
         $this->imageStyle->addImageEffect($this->imageEffect->getConfiguration());
     }
     $this->imageStyle->save();
     drupal_set_message($this->t('The image effect was successfully applied.'));
     $form_state->setRedirectUrl($this->imageStyle->urlInfo('edit-form'));
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, array &$form_state)
 {
     form_state_values_clean($form_state);
     // The image effect configuration is stored in the 'data' key in the form,
     // pass that through for submission.
     $effect_data = array('values' => &$form_state['values']['data']);
     $this->imageEffect->submitConfigurationForm($form, $effect_data);
     $this->imageEffect->setWeight($form_state['values']['weight']);
     if (!$this->imageEffect->getUuid()) {
         $this->imageStyle->addImageEffect($this->imageEffect->getConfiguration());
     }
     $this->imageStyle->save();
     drupal_set_message($this->t('The image effect was successfully applied.'));
     $form_state['redirect_route'] = $this->imageStyle->urlInfo('edit-form');
 }