You are here

public function AutomatedCropEffect::submitConfigurationForm in Automated Crop 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/AutomatedCropEffect.php, line 220

Class

AutomatedCropEffect
Provide an Automatic crop tools.

Namespace

Drupal\automated_crop\Plugin\ImageEffect

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
  parent::submitConfigurationForm($form, $form_state);
  $this->configuration['width'] = $form_state
    ->getValue('width');
  $this->configuration['height'] = $form_state
    ->getValue('height');
  $this->configuration['min_width'] = $form_state
    ->getValue('min_sizes')['min_width'];
  $this->configuration['min_height'] = $form_state
    ->getValue('min_sizes')['min_height'];
  $this->configuration['max_width'] = $form_state
    ->getValue('max_sizes')['max_width'];
  $this->configuration['max_height'] = $form_state
    ->getValue('max_sizes')['max_height'];
  $this->configuration['aspect_ratio'] = $form_state
    ->getValue('aspect_ratio');
  $this->configuration['provider'] = $form_state
    ->getValue('provider', 'automated_crop_default');
}