function tmgmt_local_form_tmgmt_settings_form_submit

Submit callback for tmgmt_settings_form.

1 string reference to 'tmgmt_local_form_tmgmt_settings_form_submit'

File

translators/tmgmt_local/tmgmt_local.module, line 165
Main module file for the local translation module.

Code

function tmgmt_local_form_tmgmt_settings_form_submit($form, FormStateInterface $form_state) {
  $config = \Drupal::configFactory()
    ->getEditable('tmgmt_local.settings');
  if ($config
    ->get('use_admin_theme') != $form_state
    ->getValue('use_admin_theme')) {
    $config
      ->set('use_admin_theme', $form_state
      ->getValue('use_admin_theme'))
      ->save();
    \Drupal::service('router.builder')
      ->rebuild();
  }
  $config
    ->set('allow_all', $form_state
    ->getValue('allow_all'))
    ->save();
}