On this page
function system_add_date_format_type_form_submit
system_add_date_format_type_form_submit($form, &$form_state)
Process system_add_date_format_type form submissions.
File
- modules/system/system.admin.inc, line 2186
- Admin page callbacks for the system module.
Code
function system_add_date_format_type_form_submit($form, &$form_state) {
$machine_name = trim($form_state['values']['machine_name']);
$format_type = array();
$format_type['title'] = trim($form_state['values']['date_type']);
$format_type['type'] = $machine_name;
$format_type['locked'] = 0;
$format_type['is_new'] = 1;
system_date_format_type_save($format_type);
variable_set('date_format_' . $machine_name, $form_state['values']['date_format']);
drupal_set_message(t('New date type added successfully.'));
$form_state['redirect'] = 'admin/config/regional/date-time';
}
© 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_format_type_form_submit/7.x