You are here

public function AdminSettingsForm::submitForm in Advanced Forum 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/AdminSettingsForm.php, line 348
Contains \Drupal\advanced_forum\Form\AdminSettingsForm.

Class

AdminSettingsForm
Defines a form that configures advanced forum settings.

Namespace

Drupal\advanced_forum\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->config('advanced_forum_forum_image.settings')
    ->set('advanced_forum_forum_image_preset', $form_state
    ->getValue('advanced_forum_forum_image_preset'))
    ->set('advanced_forum_forum_image_field', $form_state
    ->getValue('advanced_forum_forum_image_field'))
    ->save();
  $this
    ->config('advanced_forum_general.settings')
    ->set('advanced_forum_author_pane_join_date_type', $form_state
    ->getValue('advanced_forum_author_pane_join_date_type'))
    ->set('advanced_forum_user_picture_preset', $form_state
    ->getValue('advanced_forum_user_picture_preset'))
    ->set('advanced_forum_forum_user_term_fields', $form_state
    ->getValue('advanced_forum_forum_user_term_fields'))
    ->set('advanced_forum_keep_classes', $form_state
    ->getValue('advanced_forum_keep_classes'))
    ->set('advanced_forum_views_as_tabs', $form_state
    ->getValue('advanced_forum_views_as_tabs'))
    ->set('advanced_forum_add_local_task', $form_state
    ->getValue('advanced_forum_add_local_task'))
    ->set('advanced_forum_style_all_comments', $form_state
    ->getValue('advanced_forum_style_all_comments'))
    ->set('advanced_forum_style_only_forum_tagged', $form_state
    ->getValue('advanced_forum_style_only_forum_tagged'))
    ->set('advanced_forum_style_teasers', $form_state
    ->getValue('advanced_forum_style_teasers'))
    ->set('advanced_forum_styled_node_types', $form_state
    ->getValue('advanced_forum_styled_node_types'))
    ->set('advanced_forum_style', $form_state
    ->getValue('advanced_forum_style'))
    ->save();
  $this
    ->config('advanced_forum_lists.settings')
    ->set('advanced_forum_last_post_query', $form_state
    ->getValue('advanced_forum_last_post_query'))
    ->set('advanced_forum_topic_title_length', $form_state
    ->getValue('advanced_forum_topic_title_length'))
    ->set('advanced_forum_get_new_comments', $form_state
    ->getValue('advanced_forum_get_new_comments'))
    ->set('advanced_forum_default_collapsed_list', $form_state
    ->getValue('advanced_forum_default_collapsed_list'))
    ->set('advanced_forum_collapsible_containers', $form_state
    ->getValue('advanced_forum_collapsible_containers'))
    ->set('advanced_forum_disable_breadcrumbs', $form_state
    ->getValue('advanced_forum_disable_breadcrumbs'))
    ->save();
  $this
    ->config('advanced_forum_autoload.settings')
    ->set('advanced_forum_autoload_views', $form_state
    ->getValue('advanced_forum_autoload_views'))
    ->set('advanced_forum_autoload_page_handlers', $form_state
    ->getValue('advanced_forum_autoload_page_handlers'))
    ->save();
  parent::submitForm($form, $form_state);
}