1 language.admin.inc language_admin_overview_form_submit($form, &$form_state)

Process language overview form submissions, updating existing languages.

File

core/modules/language/language.admin.inc, line 89
Admin page callbacks for the Language module.

Code

function language_admin_overview_form_submit($form, &$form_state) {
  $languages = language_list();
  $old_default = language_default();

  foreach ($languages as $langcode => $language) {
    $language->default = ($form_state['values']['site_default'] == $langcode);
    $language->weight = $form_state['values']['languages'][$langcode]['weight'];

    if ($language->default || $old_default->langcode == $langcode) {
      // Automatically enable the default language and the language
      // which was default previously (because we will not get the
      // value from that disabled checkbox).
      $form_state['values']['languages'][$langcode]['enabled'] = 1;
    }
    $language->enabled = (int) !empty($form_state['values']['languages'][$langcode]['enabled']);

    language_save($language);
  }
  // Display status messages for this form.
  backdrop_set_message(t('The configuration options have been saved.'));
}