You are here

function date_locale_format_form_formats_submit in Date 6.2

Submit handler for choosing a language on the date_locale_format_form.

1 string reference to 'date_locale_format_form_formats_submit'
date_locale_format_form in date_locale/date_locale.module
Display list of enabled languages to configure date formats for.

File

date_locale/date_locale.module, line 241
Enable different locales to have their own date formats.

Code

function date_locale_format_form_formats_submit($form, &$form_state) {
  $langcode = $form_state['storage']['langcode'];

  // Get list of date format types.
  $types = date_get_format_types();
  foreach ($types as $type => $type_info) {
    $format = $form_state['values']['date_format_' . $type];
    if ($format == 'custom') {
      $format = $form_state['values']['date_format_' . $type . '_custom'];
    }
    date_locale_locale_format_save($langcode, $type, $format);
  }
  drupal_set_message(t('Configuration saved.'));
  $form_state['storage'] = FALSE;
  $form_state['rebuild'] = FALSE;
  $form_state['redirect'] = 'admin/settings/date-time/locale';
}