You are here

function l10n_update_admin_settings_form_submit in Localization update 7.2

Same name and namespace in other branches
  1. 6 l10n_update.admin.inc \l10n_update_admin_settings_form_submit()
  2. 7 l10n_update.admin.inc \l10n_update_admin_settings_form_submit()

Submit handler for translation update settings.

1 string reference to 'l10n_update_admin_settings_form_submit'
l10n_update_admin_settings_form in ./l10n_update.admin.inc
Page callback: Settings form.

File

./l10n_update.admin.inc, line 325
Admin settings and update page.

Code

function l10n_update_admin_settings_form_submit($form, &$form_state) {

  // Invalidate the cached translation status when the configuration setting of
  // 'l10n_update_check_mode' or 'check_disabled' change.
  if ($form['l10n_update_check_mode']['#default_value'] != $form_state['values']['l10n_update_check_mode'] || $form['l10n_update_check_disabled']['#default_value'] != $form_state['values']['l10n_update_check_disabled']) {
    l10n_update_clear_status();
  }

  // Convert the disabled projects input into an array value. The input value is
  // removed from the form_state values to prevent it being turned into a
  // variable.
  $input = $form_state['values']['disabled_projects'];
  unset($form_state['values']['disabled_projects']);
  $input = strtr($input, array(
    "\r" => '',
    ' ' => '',
  ));
  $values = array_filter(explode("\n", $input));
  variable_set('l10n_update_disabled_projects', $values);

  // Add .htaccess file to the translations directory.
  l10n_update_ensure_htaccess();
}