You are here

function en8_add_contributors in Bibliography Module 7.2

Same name and namespace in other branches
  1. 6.2 modules/endnote/endnote8_export.inc \en8_add_contributors()
  2. 6 endnote8_export.inc \en8_add_contributors()
  3. 7 modules/endnote/endnote8_export.inc \en8_add_contributors()
1 call to en8_add_contributors()
_endnote8_XML_export in modules/endnote/endnote8_export.inc

File

modules/endnote/endnote8_export.inc, line 130

Code

function en8_add_contributors(&$node) {
  $xml = '<contributors>';
  $authors = biblio_get_contributor_category($node->biblio_contributors, 1);
  if (!empty($authors)) {
    $xml .= "<authors>";
    foreach ($authors as $auth) {
      $xml .= '<author><style face="normal" font="default" size="100%">';
      $xml .= htmlspecialchars(trim($auth['name']));

      // insert author here.
      $xml .= "</style></author>";
    }
    $xml .= "</authors>";
  }
  $authors = biblio_get_contributor_category($node->biblio_contributors, 2);
  if (!empty($authors)) {
    $xml .= "<secondary-authors>";
    foreach ($authors as $auth) {
      $xml .= '<author><style face="normal" font="default" size="100%">';
      $xml .= htmlspecialchars(trim($auth['name']));

      // insert author here.
      $xml .= "</style></author>";
    }
    $xml .= "</secondary-authors>";
  }
  $authors = biblio_get_contributor_category($node->biblio_contributors, 3);
  if (!empty($authors)) {
    $xml .= "<tertiary-authors>";
    foreach ($authors as $auth) {
      $xml .= '<author><style face="normal" font="default" size="100%">';
      $xml .= htmlspecialchars(trim($auth['name']));

      // insert author here.
      $xml .= "</style></author>";
    }
    $xml .= "</tertiary-authors>";
  }
  $authors = biblio_get_contributor_category($node->biblio_contributors, 4);
  if (!empty($authors)) {
    $xml .= "<subsidiary-authors>";
    foreach ($authors as $auth) {
      $xml .= '<author><style face="normal" font="default" size="100%">';
      $xml .= htmlspecialchars(trim($auth['name']));

      // insert author here.
      $xml .= "</style></author>";
    }
    $xml .= "</subsidiary-authors>";
  }
  $authors = biblio_get_contributor_category($node->biblio_contributors, 5);
  if (!empty($authors)) {
    $xml .= "<translated-authors>";
    foreach ($authors as $auth) {
      $xml .= '<author><style face="normal" font="default" size="100%">';
      $xml .= htmlspecialchars(trim($auth['name']));

      // insert author here.
      $xml .= "</style></author>";
    }
    $xml .= "</translated-authors>";
  }
  $xml .= '</contributors>';
  unset($node->biblio_contributors);
  return $xml;
}