You are here

function biblio_contributor_form_submit in Bibliography Module 7.2

Glue code between the form and the biblio_contributor_save() function.

@global type $user

Parameters

type $form:

array $form_state:

2 string references to 'biblio_contributor_form_submit'
biblio_contributor_add_form in ./biblio.module
Build the contributor add form Called by the Form API
biblio_contributor_form in ./biblio.module

File

./biblio.module, line 3532

Code

function biblio_contributor_form_submit($form, &$form_state) {
  global $user;

  // Pull the old biblio object out of the $form_state variable.
  $contributor =& $form_state['contributor'];

  // Set the biblio's uid if it's being created at this time.
  if (empty($contributor->uid)) {
    $contributor->uid = $user->uid;
  }

  // Notify field widgets.
  field_attach_submit('biblio_contributor', $contributor, $form, $form_state);

  // Save the contributor.
  biblio_contributor_save($contributor);

  // Notify the user.
  drupal_set_message(t('Contributor saved.'));
  $form_state['redirect'] = 'biblio/contributor/' . $contributor->cid;
}