You are here

function biblio_openurl in Bibliography Module 7.2

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

Parameters

$node:

Return value

unknown_type

5 calls to biblio_openurl()
biblio_entry in includes/biblio.pages.inc
biblio_handler_citation::render in views/biblio_handler_citation.inc
Render the field.
biblio_plugin_row_citation::render in views/biblio_plugin_row_citation.inc
Render a row object. This usually passes through to a theme template of some form, but not always.
theme_biblio_entry in includes/biblio.theme.inc
theme_biblio_long in includes/biblio.theme.inc
DEPRECIATED! this was the original output format which is not to flexable it will be removed TODO: remove this function

File

includes/biblio.theme.inc, line 31

Code

function biblio_openurl($node) {
  global $user;
  $open_url = '';

  // 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 $open_url_resolver; // these variables are defined in 'ini.inc.php'
  //  global $hostInstitutionAbbrevName;
  $open_url_resolver = !empty($user->data['biblio_baseopenurl']) ? $user->data['biblio_baseopenurl'] : '';
  if (empty($open_url_resolver)) {
    $open_url_resolver = variable_get('biblio_baseopenurl', '');
  }
  if (!empty($open_url_resolver)) {
    $co = biblio_contextObject($node);
    $sid = "biblio:" . variable_get('site_name', 'Drupal');
    $user_sid = !empty($user->data['biblio_openurl_sid']) ? $user->data['biblio_openurl_sid'] : '';
    $co["sid"] = !empty($user_sid) ? $user_sid : variable_get('biblio_openurl_sid', $sid);
    $open_url = $open_url_resolver;
    if (!preg_match("/\\?/", $open_url_resolver)) {
      $open_url .= "?";
    }
    else {
      $open_url .= "&amp;";
    }
    $open_url .= "ctx_ver=Z39.88-2004";
    foreach ($co as $coKey => $coValue) {
      $coKey = preg_replace("/rft./", "", $coKey);
      $coKey = preg_replace("/au[0-9]*/", "au", $coKey);
      $open_url .= "&amp;" . $coKey . "=" . rawurlencode($coValue);
    }
  }
  return $open_url;
}