You are here

function biblio_openURL in Bibliography Module 5

Same name and namespace in other branches
  1. 6.2 includes/biblio_theme.inc \biblio_openURL()
  2. 6 biblio_theme.inc \biblio_openURL()
  3. 7 includes/biblio_theme.inc \biblio_openurl()
  4. 7.2 includes/biblio.theme.inc \biblio_openurl()

File

./biblio.module, line 3658

Code

function biblio_openURL($node) {

  // Copyright:          Matthias Steffens <mailto:refbase@extracts.de> and the file's
  //                     original author.
  // Original Author:    Richard Karnesky <mailto:karnesky@gmail.com>  //
  // Adapted for biblio: Ron Jerome
  //  global $openURLResolver; // these variables are defined in 'ini.inc.php'
  //  global $hostInstitutionAbbrevName;
  $openURLResolver = check_plain(variable_get('biblio_baseopenurl', ''));
  $co = biblio_contextObject($node);
  $co["sid"] = "biblio:" . variable_get('site_name', 'Drupal');
  $openURL = $openURLResolver;
  if (!ereg("\\?", $openURLResolver)) {
    $openURL .= "?";
  }
  else {
    $openURL .= "&amp;";
  }
  $openURL .= "ctx_ver=Z39.88-2004";
  foreach ($co as $coKey => $coValue) {
    $coKey = ereg_replace("rft.", "", $coKey);
    $coKey = ereg_replace("au[0-9]*", "au", $coKey);
    $openURL .= "&amp;" . $coKey . "=" . rawurlencode($coValue);
  }
  return $openURL;
}