You are here

public function LearningPathAdminSettingsForm::submitForm in Opigno Learning path 3.x

Same name and namespace in other branches
  1. 8 src/Form/LearningPathAdminSettingsForm.php \Drupal\opigno_learning_path\Form\LearningPathAdminSettingsForm::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

src/Form/LearningPathAdminSettingsForm.php, line 225

Class

LearningPathAdminSettingsForm
Class LearningPathAdminSettingsForm.

Namespace

Drupal\opigno_learning_path\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $this
    ->config('opigno_learning_path.learning_path_settings')
    ->set('opigno_learning_path_notify_admin', $form_state
    ->getValue('opigno_learning_path_notify_admin'))
    ->set('opigno_learning_path_notify_admin_mails', $form_state
    ->getValue('opigno_learning_path_notify_admin_mails'))
    ->set('opigno_learning_path_notify_users', $form_state
    ->getValue('opigno_learning_path_notify_users'))
    ->set('opigno_learning_path_notify_admin_user_subscribed', $form_state
    ->getValue('opigno_learning_path_notify_admin_user_subscribed'))
    ->set('opigno_learning_path_notify_admin_user_approval', $form_state
    ->getValue('opigno_learning_path_notify_admin_user_approval'))
    ->set('opigno_learning_path_notify_admin_user_blocked', $form_state
    ->getValue('opigno_learning_path_notify_admin_user_blocked'))
    ->set('opigno_learning_path_notify_user_user_subscribed', $form_state
    ->getValue('opigno_learning_path_notify_user_user_subscribed'))
    ->set('opigno_learning_path_notify_user_user_approval', $form_state
    ->getValue('opigno_learning_path_notify_user_user_approval'))
    ->set('opigno_learning_path_notify_user_user_blocked', $form_state
    ->getValue('opigno_learning_path_notify_user_user_blocked'))
    ->set('opigno_learning_path_notify_user_user_certificate_expired', $form_state
    ->getValue('opigno_learning_path_notify_user_user_certificate_expired'))
    ->set('opigno_learning_path_student_does_activity_notify', $form_state
    ->getValue('opigno_learning_path_student_does_activity_notify'))
    ->set('opigno_learning_path_student_does_activity', $form_state
    ->getValue('opigno_learning_path_student_does_activity'))
    ->set('opigno_learning_path_students_answer_is_reviewed_notify', $form_state
    ->getValue('opigno_learning_path_students_answer_is_reviewed_notify'))
    ->set('opigno_learning_path_students_answer_is_reviewed', $form_state
    ->getValue('opigno_learning_path_students_answer_is_reviewed'))
    ->save();
}