You are here

function biblio_view in Bibliography Module 7

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

Implements hook_view().

File

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

Code

function biblio_view($node, $buildmode = 'full') {
  global $user;
  $links = array();
  $style = biblio_get_style();
  $base = variable_get('biblio_base', 'biblio');
  $base_title = check_plain(variable_get('biblio_base_title', 'Biblio'));
  switch ($buildmode) {
    case 'full':
    case 'print':
      if (variable_get('biblio_hide_bibtex_braces', 0) && !isset($node->view)) {
        $node->title = biblio_remove_brace($node->title);
        drupal_set_title(filter_xss($node->title, biblio_get_allowed_tags()));
      }

    // Fall through.
    case 'search_index':
      switch (variable_get('biblio_node_layout', 'tabular')) {
        case 'orig':
        case 'ft':
          $node->content['body']['#markup'] = theme('biblio_long', array(
            'node' => $node,
            'base' => $base,
            'style_name' => $style,
          ));
          break;
        case 'cite':
          $node->content['body']['#markup'] = theme('biblio_style', array(
            'node' => $node,
            'base' => $base,
            'style_name' => $style,
          ));
          break;
        case 'tabular':
        default:
          $node->content['body']['#markup'] = theme('biblio_tabular', array(
            'node' => $node,
            'base' => $base,
          ));
          break;
      }
      break;
    case 'teaser':
      $node->content['teaser']['#markup'] = theme('biblio_style', array(
        'node' => $node,
        'base' => $base,
        'style_name' => $style,
      ));
      break;
  }
  return $node;
}