You are here

public function biblio_handler_citation::render in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 views/biblio_handler_citation.inc \biblio_handler_citation::render()
  2. 6 views/biblio_handler_citation.inc \biblio_handler_citation::render()
  3. 7.2 views/biblio_handler_citation.inc \biblio_handler_citation::render()

Render the field.

Parameters

array $values: The values retrieved from the database.

Overrides views_handler_field::render

File

views/biblio_handler_citation.inc, line 100

Class

biblio_handler_citation

Code

public function render($values) {
  $output = '';
  if (!isset($values->node) || $values->node->type != 'biblio') {
    return;
  }
  if (empty($this->biblio_base)) {
    $this->biblio_base = variable_get('biblio_base', 'biblio');
  }
  $item = $values->node;
  if (isset($item->biblio_year)) {
    $item->biblio_year = _biblio_text_year($item->biblio_year);
  }
  if (variable_get('biblio_hide_bibtex_braces', 0)) {
    $item->title = biblio_remove_brace($item->title);
  }
  if (!$item->status) {
    $output .= '<div id="node-' . $item->nid . '" class="node node-unpublished">';
  }

  // First add the styled entry...
  $output .= theme('biblio_style', array(
    'node' => $item,
    'style_name' => $this->options['style_name'],
  ));
  $annotation_field = variable_get('biblio_annotations', 'none');
  if ($annotation_field != 'none' && $item->{$annotation_field}) {
    $output .= '<div class="biblio-annotation">';
    $output .= filter_xss($item->{$annotation_field}, biblio_get_allowed_tags());
    $output .= '</div>';
  }
  $openurl_base = variable_get('biblio_baseopenurl', '');
  if (!empty($openurl_base) && $this->options['open_url_link']) {
    $output .= theme('biblio_openurl', array(
      'openURL' => biblio_openurl($item),
    ));
  }
  if (biblio_access('export') && $this->options['export_links']) {
    $output .= theme('biblio_export_links', array(
      'node' => $item,
    ));
  }
  if (biblio_access('download', $item) && $this->options['file_attachments']) {
    $output .= theme('biblio_download_links', array(
      'node' => $item,
    ));
  }
  if (!$item->status) {
    $output .= '</div>';
  }
  return $output;
}