You are here

function biblio_ris_biblio_export in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 modules/RIS/biblio_ris.module \biblio_ris_biblio_export()
  2. 7.2 modules/RIS/biblio_ris.module \biblio_ris_biblio_export()

File

modules/RIS/biblio_ris.module, line 197

Code

function biblio_ris_biblio_export($nids) {
  if (module_exists('popups') && $nid) {
    $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.ris"');
  }
  $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_ris_export($node);
    }
    else {
      $popup_data .= _biblio_ris_export($node);
    }
  }
  if ($popup && !empty($popup_data)) {
    return '<pre>' . $popup_data . '</pre>';
  }
}