You are here

function name_custom_formats_form_submit in Name Field 6

Same name and namespace in other branches
  1. 7 name.admin.inc \name_custom_formats_form_submit()

Submit handler for name_custom_formats_form().

File

./name.admin.inc, line 243
General administration functions.

Code

function name_custom_formats_form_submit($form, &$form_state) {
  $values = $form_state['values'];
  if (empty($values['ncfid'])) {
    drupal_write_record('name_custom_format', $values);
    $message = 'Custom format %name has been created.';
  }
  else {
    drupal_write_record('name_custom_format', $values, 'ncfid');
    $message = 'Custom format %name has been updated.';
  }
  drupal_set_message(t($message, array(
    '%name' => $values['name'],
  )));
  $form_state['redirect'] = 'admin/settings/name';
}