You are here

function certificate_sets_form_submit in Certificate 6

Save/Update a certificate type.

File

./certificate.admin.inc, line 125
Administrative pages for the module.

Code

function certificate_sets_form_submit($form, &$form_state) {
  $action = 'saved';
  if ($form_state['values']['type_id']) {
    $update = 'type_id';
    $action = 'updated';
  }
  $write = $form_state['values'];
  drupal_write_record('certificate_types', $write, $update);
  drupal_set_message(t("Certificate type {$action}."));
  drupal_goto('admin/settings/certificate/sets');
}