コード例 #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'));
 }
コード例 #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');
 }
コード例 #3
0
 /**
  * {@inheritdoc}
  */
 public function deleteImageEffect(ImageEffectInterface $effect)
 {
     $this->getEffects()->removeInstanceId($effect->getUuid());
     $this->save();
     return $this;
 }
コード例 #4
0
ファイル: ImageEffectDeleteForm.php プロジェクト: shumer/blog
 /**
  * {@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');
 }
コード例 #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'));
 }