You are here

function biblio_tagged_biblio_export in Bibliography Module 7.2

Same name and namespace in other branches
  1. 6.2 modules/endnote/biblio_tagged.module \biblio_tagged_biblio_export()
  2. 7 modules/endnote/biblio_tagged.module \biblio_tagged_biblio_export()

File

modules/endnote/biblio_tagged.module, line 110

Code

function biblio_tagged_biblio_export($nids) {
  if (module_exists('popups') && count($nids)) {
    $popup = TRUE;
  }
  else {
    $popup = FALSE;
    drupal_add_http_header('Content-type', 'application/x-endnote-refer');
    drupal_add_http_header('Content-Disposition', 'attachment; filename="Drupal-Biblio.enw"');
  }
  $nodes = node_load_multiple($nids, array(), TRUE);
  foreach ($nodes as $node) {
    if (variable_get('biblio_hide_bibtex_braces', 0)) {
      $node->title = biblio_remove_brace($node->title);
    }
    if (!$popup) {
      print _biblio_tagged_export($node);
    }
    else {
      $popup_data .= _biblio_tagged_export($node);
    }
  }
  if ($popup && !empty($popup_data)) {
    return '<pre>' . $popup_data . '</pre>';
  }
}