You are here

function biblio_bibtex_form_biblio_form_submit in Bibliography Module 7.2

1 string reference to 'biblio_bibtex_form_biblio_form_submit'
biblio_bibtex_form_biblio_form_alter in modules/bibtexParse/biblio_bibtex.module
Implements hook_form_FORM_ID_alter @global type $user

File

modules/bibtexParse/biblio_bibtex.module, line 68

Code

function biblio_bibtex_form_biblio_form_submit($form, &$form_state) {
  global $user;
  $biblio_data = array();
  $dups = array();
  if (strlen($form_state['values']['paste_data_bibtex'])) {
    list($biblio_data, $dups) = biblio_bibtex_biblio_import($form_state['values']['paste_data_bibtex'], array(), FALSE, NULL, FALSE, TRUE);
  }
  $biblio = reset($biblio_data);
  if (!empty($biblio_data) && is_object($biblio)) {
    $form_state['input']['publication_type'] = $form_state['publication_type'] = $biblio->publication_type;
    $form_state['biblio_imported_contributors'] = $biblio->biblio_contributors;
    $form_state['biblio_imported'] = $biblio;

    //    $form_state['storage']['biblio_type']  = $node_data[0]->biblio_type;
  }
  elseif (!empty($dups)) {
    $message = t('The bibtex entity that you are trying to paste into the form already exists in the database, see !url', array(
      '!url' => l('biblio/' . $dups[0], 'biblio/' . $dups[0]),
    ));
    form_set_error('paste_data_bibtex', $message);
  }
  $form_state['rebuild'] = TRUE;
  return;
}