You are here

public function FeatureSettingsForm::submitForm in Ubercart 8.4

Same name in this branch
  1. 8.4 uc_file/src/Form/FeatureSettingsForm.php \Drupal\uc_file\Form\FeatureSettingsForm::submitForm()
  2. 8.4 uc_role/src/Form/FeatureSettingsForm.php \Drupal\uc_role\Form\FeatureSettingsForm::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 ConfigFormBase::submitForm

File

uc_file/src/Form/FeatureSettingsForm.php, line 136

Class

FeatureSettingsForm
Grants roles upon accepted payment of products.

Namespace

Drupal\uc_file\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {

  // No directory now; truncate the file list.
  if ($form_state
    ->isValueEmpty('base_dir')) {
    uc_file_empty();
  }
  else {
    uc_file_refresh();
  }
  $file_config = $this
    ->config('uc_file.settings');
  $file_config
    ->set('base_dir', $form_state
    ->getValue('base_dir'))
    ->set('duplicate_warning', $form_state
    ->getValue('duplicate_warning'))
    ->set('download_limit_number', $form_state
    ->getValue('download_limit_number'))
    ->set('download_limit_addresses', $form_state
    ->getValue('download_limit_addresses'))
    ->set('duration_qty', $form_state
    ->getValue('duration_qty'))
    ->set('duration_granularity', $form_state
    ->getValue('duration_granularity'))
    ->save();
  parent::submitForm($form, $form_state);
}