You are here

function biblio_bibtex_biblio_export in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 modules/bibtexParse/biblio_bibtex.module \biblio_bibtex_biblio_export()
  2. 7.2 modules/bibtexParse/biblio_bibtex.module \biblio_bibtex_biblio_export()

File

modules/bibtexParse/biblio_bibtex.module, line 226

Code

function biblio_bibtex_biblio_export($nids) {
  if (module_exists('popups') && $nid) {
    $popup = TRUE;
  }
  else {
    $popup = FALSE;
    drupal_add_http_header('Content-type', 'application/text; charset=utf-8');
    drupal_add_http_header('Content-Disposition', 'attachment; filename="Biblio-Bibtex.bib"');
  }
  $nodes = node_load_multiple($nids, array(), TRUE);
  foreach ($nodes as $node) {
    if (!$popup) {
      print _biblio_bibtex_export($node);
    }
    else {
      $popup_data .= _biblio_bibtex_export($node);
    }
  }
  if ($popup && !empty($popup_data)) {
    return '<pre>' . $popup_data . '</pre>';
  }
}