You are here

function biblio_xml_biblio_export in Bibliography Module 6.2

Same name and namespace in other branches
  1. 7 modules/endnote/biblio_xml.module \biblio_xml_biblio_export()
  2. 7.2 modules/endnote/biblio_xml.module \biblio_xml_biblio_export()
1 string reference to 'biblio_xml_biblio_export'
biblio_xml_menu in modules/endnote/biblio_xml.module

File

modules/endnote/biblio_xml.module, line 160

Code

function biblio_xml_biblio_export($nid = null) {
  $nids = array();
  if ($nid === null && isset($_SESSION['last_biblio_query']) && !empty($_SESSION['last_biblio_query'])) {
    $query = $_SESSION['last_biblio_query'];
    $params = $_SESSION['last_biblio_query_terms'];
    $result = db_query($query, $params);
    while ($node = db_fetch_object($result)) {
      $nids[] = $node->nid;
    }
  }
  elseif (!empty($nid)) {
    $nids[] = $nid;
  }
  elseif (!count($nids)) {
    return;
  }
  module_load_include('inc', 'biblio_xml', 'endnote8_export');
  drupal_set_header('Content-type: application/xml; charset=utf-8');
  drupal_set_header('Content-Disposition: attachment; filename="Biblio-EndNote' . $version . '.xml"');
  print _endnote8_XML_export('', 'begin');
  foreach ($nids as $nid) {
    $node = node_load($nid, FALSE, TRUE);
    if (variable_get('biblio_hide_bibtex_braces', 0)) {
      $node->title = biblio_remove_brace($node->title);
    }
    print _endnote8_XML_export($node);
  }
  print _endnote8_XML_export('', 'end');
}