You are here

function biblio_marc_biblio_export in Bibliography Module 7

File

modules/marcParse/biblio_marc.module, line 292

Code

function biblio_marc_biblio_export($nids) {
  if (module_exists('popups') && count($nids)) {
    $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.mrc"');
  }
  $nodes = node_load_multiple($nids, array(), TRUE);
  foreach ($nodes as $node) {
    if (!$popup) {
      print _biblio_marc_export($node);
    }
    else {
      $popup_data .= _biblio_marc_export($node);
    }
  }
  if ($popup && !empty($popup_data)) {
    return '<pre>' . $popup_data . '</pre>';
  }
}