You are here

public function PiwikReportsSettings::submitForm in Piwik Reports 8

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

src/Form/PiwikReportsSettings.php, line 133

Class

PiwikReportsSettings
Class PiwikReportsSettings.

Namespace

Drupal\piwik_reports\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $this
    ->config('piwik_reports.piwikreportssettings')
    ->set('piwik_report_server', $form_state
    ->getValue('piwik_report_server'))
    ->set('piwik_server_url', $form_state
    ->getValue('piwik_server_url'))
    ->set('token_auth', $form_state
    ->getValue('token_auth'))
    ->set('piwik_reports_token_auth', $form_state
    ->getValue('piwik_reports_token_auth'))
    ->set('piwik_reports_sites', $form_state
    ->getValue('piwik_reports_sites'))
    ->set('piwik_reports_allowed_sites', $form_state
    ->getValue('piwik_reports_allowed_sites'))
    ->save();
}