You are here

function _biblio_citekey_print in Bibliography Module 7

Same name and namespace in other branches
  1. 5 biblio.module \_biblio_citekey_print()
  2. 6.2 biblio.module \_biblio_citekey_print()
  3. 6 biblio.module \_biblio_citekey_print()
  4. 7.2 biblio.module \_biblio_citekey_print()

Filter Largely inspired from the footnote module.

3 calls to _biblio_citekey_print()
_biblio_filter_footnote_callback in ./biblio.module
_biblio_filter_replace_callback in ./biblio.module
Helper function called from preg_replace_callback() above.
_biblio_inline_filter_replace_callback in ./biblio.module

File

./biblio.module, line 2103
Bibliography Module for Drupal.

Code

function _biblio_citekey_print($citekey) {
  $nid = db_query("SELECT nid FROM {biblio} WHERE biblio_citekey = :key", array(
    ':key' => $citekey,
  ))
    ->fetchField();
  if ($nid) {
    $style = biblio_get_style();
    $base = variable_get('biblio_base', 'biblio');
    $node = node_load($nid);
    return theme('biblio_style', array(
      'node' => $node,
      'base' => $base,
      'style_name' => $style,
    ));
  }
  else {
    return t("Citekey @cite not found", array(
      '@cite' => $citekey,
    ));
  }
}