You are here

function biblio_entry in Bibliography Module 7.2

Same name and namespace in other branches
  1. 7 includes/biblio.pages.inc \biblio_entry()
1 call to biblio_entry()
biblio_page_content in includes/biblio.pages.inc

File

includes/biblio.pages.inc, line 224

Code

function biblio_entry($biblio) {
  $entry = array();
  $style = biblio_get_style();

  /*
    $select_box = array(
      '#type' => 'checkbox',
      '#return_value'  => $node->nid,
      '#default_value' => 0,
      '#attributes' => array('class' => array('biblio-export-selector'),)

    );
  */
  $prefix = '<div class="biblio-entry">';
  $suffix = '</div>';

  // @todo: get rid of below line and add published/unpublished support. See http://drupal.org/node/1537396
  $biblio->status = 1;
  if (!$biblio->status) {
    $prefix .= '<div id="node-' . $biblio->bid . '" class="node node-unpublished">';
    $suffix .= '</div>';
  }

  //  $prefix .= theme('checkbox', array('element' => $select_box));
  $entry = array(
    '#prefix' => $prefix,
    '#suffix' => $suffix,
  );
  $entry['entry']['#markup'] = theme('biblio_style', array(
    'biblio' => $biblio,
    'style_name' => $style,
  ));
  $annotation_field = variable_get('biblio_annotations', 'none');
  if ($annotation_field != 'none' && $biblio->{$annotation_field}) {
    $entry['annotation'] = array(
      '#prefix' => '<div class="biblio-annotation">',
      '#markup' => filter_xss($biblio->{$annotation_field}, biblio_get_allowed_tags()),
      '#suffix' => '</div>',
    );
  }
  $openurl_base = variable_get('biblio_baseopenurl', '');
  if ($openurl_base) {
    $entry['openurl'] = array(
      '#markup' => theme('biblio_openurl', array(
        'openURL' => biblio_openurl($biblio),
      )),
    );
  }
  if (biblio_access('export')) {
    $base = variable_get('biblio_base', 'biblio');
    $entry['export_links'] = array(
      '#markup' => theme('biblio_export_links', array(
        'biblio' => $biblio,
      )),
    );
  }
  if (biblio_access('download', $biblio)) {

    // add links to attached files (if any)
    $entry['download_links'] = array(
      '#markup' => theme('biblio_download_links', array(
        'biblio' => $biblio,
      )),
    );
  }
  return $entry;
}