You are here

function en8_add_urls in Bibliography Module 7

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

File

modules/endnote/endnote8_export.inc, line 93

Code

function en8_add_urls(&$node) {
  global $base_path;
  $xml = '';

  // @todo fix URLS.
  if (!empty($node->biblio_url)) {
    $xml .= "<web-urls>";
    $xml .= '<url><style face="normal" font="default" size="100%">' . htmlspecialchars($node->biblio_url) . "</style></url>";
    $xml .= "</web-urls>";
  }
  unset($node->biblio_url);
  if (!empty($node->upload) && count($node->upload['und']) && user_access('view uploaded files')) {
    $xml .= "<related-urls>";
    foreach ($node->upload['und'] as $file) {
      $xml .= '<url><style face="normal" font="default" size="100%">';
      $xml .= htmlspecialchars(file_create_url($file['uri']));
      $xml .= "</style></url>";
    }
    $xml .= "</related-urls>";
  }
  unset($node->upload['und']);
  if (!empty($xml)) {
    return "<urls>{$xml}</urls>";
  }
}