function system_add_date_formats_form_submit
Process new date format string submission.
1 string reference to 'system_add_date_formats_form_submit'
- system_configure_date_formats_form in modules/
system/ system.admin.inc - Allow users to add additional date formats.
File
-
modules/
system/ system.admin.inc, line 2974
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';
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.