Ejemplo n.º 1
0
 /**
  * {@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'));
 }
Ejemplo n.º 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');
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function save(array $form, FormStateInterface $form_state)
 {
     parent::save($form, $form_state);
     $form_state->setRedirectUrl($this->entity->urlInfo('edit-form'));
 }
Ejemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, array &$form_state)
 {
     $this->imageStyle->deleteImageEffect($this->imageEffect);
     drupal_set_message($this->t('The image effect %name has been deleted.', array('%name' => $this->imageEffect->label())));
     $form_state['redirect_route'] = $this->imageStyle->urlInfo('edit-form');
 }
Ejemplo n.º 5
0
 /**
  * {@inheritdoc}
  */
 public function submitForm(array &$form, FormStateInterface $form_state)
 {
     $this->imageStyle->deleteImageEffect($this->imageEffect);
     drupal_set_message($this->t('The image effect %name has been deleted.', array('%name' => $this->imageEffect->label())));
     $form_state->setRedirectUrl($this->imageStyle->urlInfo('edit-form'));
 }
Ejemplo n.º 6
0
 /**
  * {@inheritdoc}
  */
 public function save(array $form, array &$form_state)
 {
     $this->entity->save();
     $form_state['redirect_route'] = $this->entity->urlInfo('edit-form');
 }