You are here

function biblio_pm_node_insert in Bibliography Module 7

File

modules/pubmed/biblio_pm.module, line 446

Code

function biblio_pm_node_insert($node) {
  if (isset($node->biblio_pubmed_id) && !empty($node->biblio_pubmed_id)) {
    $node->biblio_pm_changed = time();
    drupal_write_record('biblio_pubmed', $node);
  }
  if (isset($node->biblio_pubmed_grants) && is_array($node->biblio_pubmed_grants)) {
    foreach ($node->biblio_pubmed_grants as $grant) {
      $info = array(
        'nid' => $node->nid,
        'biblio_pubmed_id' => $node->biblio_pubmed_id,
      );
      $info += $grant;
      drupal_write_record('biblio_pubmed_grant_info', $info);
    }
  }
}