function biblio_openurl in Bibliography Module 7
Same name and namespace in other branches
- 5 biblio.module \biblio_openURL()
- 6.2 includes/biblio_theme.inc \biblio_openURL()
- 6 biblio_theme.inc \biblio_openURL()
- 7.2 includes/biblio.theme.inc \biblio_openurl()
Parameters
$node:
4 calls to biblio_openurl()
- biblio_entry in includes/
biblio.pages.inc - biblio_handler_citation::render in views/
biblio_handler_citation.inc - Render the field.
- theme_biblio_entry in includes/
biblio_theme.inc - theme_biblio_long in includes/
biblio_theme.inc - Theme function for biblio_long.
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 .= "&";
}
$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 .= "&" . $coKey . "=" . rawurlencode($coValue);
}
}
return $open_url;
}