You are here

function biblio_plugin_row_citation::render in Bibliography Module 7.2

Render a row object. This usually passes through to a theme template of some form, but not always.

Parameters

stdClass $row: A single row of the query result, so an element of $view->result.

Return value

string The rendered output of a single row, used by the style plugin.

Overrides views_plugin_row::render

File

views/biblio_plugin_row_citation.inc, line 60

Class

biblio_plugin_row_citation

Code

function render($row) {
  $output = '';
  $item = $this->nodes[$row->{$this->field_alias}];
  if (empty($this->biblio_base)) {
    $this->biblio_base = variable_get('biblio_base', 'biblio');
  }
  if ($item->type != 'biblio') {
    return;
  }
  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;
}