You are here

public function DefineCanvasImageEffect::submitConfigurationForm in Imagick 8

Form submission handler.

Parameters

array $form: An associative array containing the structure of the plugin form as built by static::buildConfigurationForm().

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Calling code should pass on a subform state created through \Drupal\Core\Form\SubformState::createForSubform().

Overrides ConfigurableImageEffectBase::submitConfigurationForm

File

src/Plugin/ImageEffect/DefineCanvasImageEffect.php, line 201

Class

DefineCanvasImageEffect
Applies the define canvas effect on an image resource.

Namespace

Drupal\imagick\Plugin\ImageEffect

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
  parent::submitConfigurationForm($form, $form_state);
  $this->configuration['HEX'] = $form_state
    ->getValue('HEX');
  $this->configuration['under'] = $form_state
    ->getValue('under');
  $this->configuration['exact_measurements'] = $form_state
    ->getValue('exact_measurements');
  $this->configuration['exact']['width'] = $form_state
    ->getValue([
    'exact',
    'width',
  ]);
  $this->configuration['exact']['height'] = $form_state
    ->getValue([
    'exact',
    'height',
  ]);
  $this->configuration['exact']['anchor'] = $form_state
    ->getValue([
    'exact',
    'anchor',
  ]);
  $this->configuration['relative']['leftdiff'] = $form_state
    ->getValue([
    'relative',
    'leftdiff',
  ]);
  $this->configuration['relative']['rightdiff'] = $form_state
    ->getValue([
    'relative',
    'rightdiff',
  ]);
  $this->configuration['relative']['topdiff'] = $form_state
    ->getValue([
    'relative',
    'topdiff',
  ]);
  $this->configuration['relative']['bottomdiff'] = $form_state
    ->getValue([
    'relative',
    'bottomdiff',
  ]);
}