You are here

function biblio_coins in Bibliography Module 7.2

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 includes/biblio.util.inc \biblio_coins()
4 calls to biblio_coins()
biblio_coins_generate in includes/biblio.util.inc
biblio_load_old in ./biblio.module
Implementation of hook_load().
biblio_update in ./biblio.module
Implementation of hook_update().
_biblio_prepare_submit in ./biblio.module
Prepare a biblio for submit to database. Contains code common to insert and update.
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 30

Code

function biblio_coins($biblio) {

  // 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 ($biblio->publication_type == 'thesis') {
    $fmt .= "dissertation";
  }
  elseif ($biblio->publication_type == 'journal_article') {
    $fmt .= "journal";
  }
  elseif ($biblio->publication_type == 'book' || $biblio->publication_type == 'book_chapter') {
    $fmt .= "book";
  }
  else {
    $fmt .= "dc";
  }
  $co = biblio_contextObject($biblio);
  $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;
}