You are here

function en8_add_contributors in Bibliography Module 6.2

Same name and namespace in other branches
  1. 6 endnote8_export.inc \en8_add_contributors()
  2. 7 modules/endnote/endnote8_export.inc \en8_add_contributors()
  3. 7.2 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>';
  if (count($node->biblio_contributors[1])) {
    $xml .= "<authors>";
    foreach ((array) $node->biblio_contributors[1] as $auth) {
      $xml .= '<author><style face="normal" font="default" size="100%">';
      $xml .= htmlspecialchars(trim($auth['name']));

      // insert author here.
      $xml .= "</style></author>";
    }
    $xml .= "</authors>";
  }
  if (isset($node->biblio_contributors[2]) && count($node->biblio_contributors[2])) {
    $xml .= "<secondary-authors>";
    foreach ((array) $node->biblio_contributors[2] 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>";
  }
  if (isset($node->biblio_contributors[3]) && count($node->biblio_contributors[3])) {
    $xml .= "<tertiary-authors>";
    foreach ((array) $node->biblio_contributors[3] 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>";
  }
  if (isset($node->biblio_contributors[4]) && count($node->biblio_contributors[4])) {
    $xml .= "<subsidiary-authors>";
    foreach ((array) $node->biblio_contributors[4] 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>";
  }
  if (isset($node->biblio_contributors[5]) && count($node->biblio_contributors[5])) {
    $xml .= "<translated-authors>";
    foreach ((array) $node->biblio_contributors[5] 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;
}