You are here

public function WebformAdminConfigExportersForm::submitForm in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Form/AdminConfig/WebformAdminConfigExportersForm.php \Drupal\webform\Form\AdminConfig\WebformAdminConfigExportersForm::submitForm()

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides WebformAdminConfigBaseForm::submitForm

File

src/Form/AdminConfig/WebformAdminConfigExportersForm.php, line 141

Class

WebformAdminConfigExportersForm
Configure webform admin settings for exporters.

Namespace

Drupal\webform\Form\AdminConfig

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $excluded_exporters = $this
    ->convertIncludedToExcludedPluginIds($this->exporterManager, $form_state
    ->getValue('excluded_exporters'));
  $values = $form_state
    ->getValues();
  $export = $this->submissionExporter
    ->getValuesFromInput($values) + [
    'excluded_exporters' => $excluded_exporters,
  ];

  // Set custom temp directory.
  $export['temp_directory'] = $values['temp_directory'] === $this->fileSystem
    ->getTempDirectory() ? '' : $values['temp_directory'];

  // Update config and submit form.
  $config = $this
    ->config('webform.settings');
  $config
    ->set('export', $export);
  parent::submitForm($form, $form_state);
}