You are here

function biblio_rtf_biblio_export in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 modules/rtf/biblio_rtf.module \biblio_rtf_biblio_export()
  2. 7.2 modules/rtf/biblio_rtf.module \biblio_rtf_biblio_export()

File

modules/rtf/biblio_rtf.module, line 89

Code

function biblio_rtf_biblio_export($nids) {
  $count = 0;
  $variables = array(
    'style_name' => biblio_get_style(),
  );
  $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);
    }
    $count++;
    $variables['node'] = $node;
    if ($count == 1) {
      $rtf = new rtf();
      $rtf
        ->setPaperSize(5);
      $rtf
        ->setPaperOrientation(1);
      $rtf
        ->setDefaultFontFace(1);
      $rtf
        ->setDefaultFontSize(24);
      $rtf
        ->setAuthor("Biblio 7.x");
      $rtf
        ->setOperator("");
      $rtf
        ->setTitle("Biblio RTF Export");
      $rtf
        ->addColour("#000000");
    }
    $rtf
      ->addText(filter_xss(theme('biblio_style', $variables) . '<br><br>', array(
      'i',
      'b',
      'br',
      'u',
      'p',
      'strong',
      'em',
      'sub',
      'sup',
      'ul',
      'li',
    )));
  }
  if ($count > 0) {
    $rtf
      ->getDocument();
  }
}