You are here

function biblio_coins in Bibliography Module 7

Same name and namespace in other branches
  1. 5 biblio.module \biblio_coins()
  2. 6.2 includes/biblio.util.inc \biblio_coins()
  3. 6 biblio.module \biblio_coins()
  4. 7.2 includes/biblio.util.inc \biblio_coins()
5 calls to biblio_coins()
biblio_coins_generate in includes/biblio.util.inc
biblio_insert in ./biblio.module
Implements hook_insert().
biblio_load in ./biblio.module
Implements hook_load().
biblio_update in ./biblio.module
Implements hook_update().
theme_biblio_tabular in includes/biblio_theme.inc
2 string references to 'biblio_coins'
biblio_csv_export_2 in includes/biblio.import.export.inc
theme_biblio_tabular in includes/biblio_theme.inc

File

includes/biblio.util.inc, line 42

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 = preg_replace("/au[0-9]*/", "au", $coKey);
    $coins .= "&amp;" . $coKey . "=" . urlencode($coValue);
  }
  $coinsSpan = "<span class=\"Z3988\" title=\"" . $coins . "\"></span>";
  return $coinsSpan;
}