You are here

function biblio_coins in Bibliography Module 5

Same name and namespace in other branches
  1. 6.2 includes/biblio.util.inc \biblio_coins()
  2. 6 biblio.module \biblio_coins()
  3. 7 includes/biblio.util.inc \biblio_coins()
  4. 7.2 includes/biblio.util.inc \biblio_coins()
3 calls to biblio_coins()
biblio_coins_generate in ./biblio.module
biblio_insert in ./biblio.module
Implementation of hook_insert().
biblio_update in ./biblio.module
Implementation of hook_update().
1 string reference to 'biblio_coins'
biblio_show_node in ./biblio.module

File

./biblio.module, line 3705

Code

function biblio_coins($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
  // fmt_info (type)
  $fmt = "info:ofi/fmt:kev:mtx:";

  // 'dissertation' is compatible with the 1.0 spec, but not the 0.1 spec
  if ($node->biblio_type == 108) {
    $fmt .= "dissertation";
  }
  elseif ($node->biblio_type == 102) {
    $fmt .= "journal";
  }
  elseif ($node->biblio_type == 100 || $node->biblio_type == 101) {
    $fmt .= "book";
  }
  else {
    $fmt .= "dc";
  }
  $co = biblio_contextObject($node);
  $coins = "ctx_ver=Z39.88-2004" . "&amp;rft_val_fmt=" . urlencode($fmt);
  foreach ($co as $coKey => $coValue) {

    // 'urlencode()' differs from 'rawurlencode() (i.e., RFC1738 encoding)
    // in that spaces are encoded as plus (+) signs
    $coKey = ereg_replace("au[0-9]*", "au", $coKey);
    $coins .= "&amp;" . $coKey . "=" . urlencode($coValue);
  }
  $coinsSpan = "<span class=\"Z3988\" title=\"" . $coins . "\"></span>";
  return $coinsSpan;
}