You are here

public function DocumentConfigForm::submitForm in Forena Reports 8

{@inherit}

Overrides ConfigFormBase::submitForm

File

src/Form/DocumentConfigForm.php, line 102

Class

DocumentConfigForm
Implements \Drupal\forena\Form\DocumentConfigForm

Namespace

Drupal\forena\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues();
  $doc_formats = array_filter($values['doc_formats']);

  // You can't disable the drupal document format
  $doc_formats['drupal'] = 'drupal';
  $doc_defaults = array_filter($values['doc_defaults']);
  $this
    ->config('forena.settings')
    ->set('doc_formats', array_values($doc_formats))
    ->set('doc_defaults', array_values($doc_defaults))
    ->set('email_input_format', $values['email_input_format'])
    ->set('email_override', $values['email_override'])
    ->save();
  parent::submitForm($form, $form_state);
}