function system_add_date_formats_form_submit

system_add_date_formats_form_submit($form, &$form_state)

Process new date format string submission.

File

modules/system/system.admin.inc, line 2945
Admin page callbacks for the system module.

Code

function system_add_date_formats_form_submit($form, &$form_state) {
  $format = array();
  $format['format'] = trim($form_state['values']['date_format']);
  $format['type'] = 'custom';
  $format['locked'] = 0;
  if (!empty($form_state['values']['dfid'])) {
    system_date_format_save($format, $form_state['values']['dfid']);
    drupal_set_message(t('Custom date format updated.'));
  }
  else {
    $format['is_new'] = 1;
    system_date_format_save($format);
    drupal_set_message(t('Custom date format added.'));
  }

  $form_state['redirect'] = 'admin/config/regional/date-time/formats';
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!system!system.admin.inc/function/system_add_date_formats_form_submit/7.x