You are here

function theme_biblio_export_links in Bibliography Module 6

Same name and namespace in other branches
  1. 5 biblio.module \theme_biblio_export_links()
  2. 6.2 includes/biblio_theme.inc \theme_biblio_export_links()
  3. 7 includes/biblio_theme.inc \theme_biblio_export_links()
  4. 7.2 includes/biblio.theme.inc \theme_biblio_export_links()

Creates a group of links for the various export functions

Parameters

$nid the node id to export (if omitted, all nodes in the current view will be exported:

Return value

an un-ordered list of class "biblio-export-buttons"

3 theme calls to theme_biblio_export_links()
biblio_show_results in ./biblio.pages.inc
biblio_show_results takes the query results from biblio_db_search and adds some controls to the page then loops through the results applying the selected style to each entry
theme_biblio_entry in ./biblio_theme.inc
theme_biblio_long in ./biblio_theme.inc
DEPRECIATED! this was the original output format which is not to flexable it will be removed TODO: remove this function

File

./biblio_theme.inc, line 881

Code

function theme_biblio_export_links($node = NULL) {
  global $pager_total_items;
  $base = variable_get('biblio_base', 'biblio');
  $show_link = variable_get('biblio_export_links', array(
    'rtf' => TRUE,
    'tagged' => TRUE,
    'xml' => TRUE,
    'bibtex' => TRUE,
  ));
  $show_link['google'] = variable_get('biblio_google_link', 1);
  $links = '';
  if ($show_link['rtf']) {
    $links .= '<li> ' . _build_biblio_link($base, $node, 'rtf') . '</li>';
  }
  if ($show_link['tagged']) {
    $links .= '<li> ' . _build_biblio_link($base, $node, 'tagged') . '</li>';
  }
  if ($show_link['xml']) {
    $links .= '<li> ' . _build_biblio_link($base, $node, 'xml') . '</li>';
  }
  if ($show_link['bibtex']) {
    $links .= '<li> ' . _build_biblio_link($base, $node, 'bibtex') . '</li>';
  }
  if ($show_link['google'] && !empty($node)) {
    $links .= '<li> ' . _build_biblio_link($base, $node, 'google') . '</li>';
  }
  if ($show_link['pubmed'] && module_exists('biblio_pm') && !empty($node)) {
    $links .= '<li> ' . _build_biblio_link($base, $node, 'pubmed') . '</li>';
  }
  if ($node) {
    $openurl_link = theme('biblio_openurl', $node);
  }
  if (!empty($openurl_link)) {
    $links .= '<li> ' . l($openurl_link['title'], $openurl_link['href'], $openurl_link) . '</li>';
  }
  if (!empty($links)) {
    $links = '<ul class="biblio-export-buttons">' . $links . '</ul>';
  }
  if (empty($node) && !empty($links)) {
    $links = t('Export @count results', array(
      '@count' => $pager_total_items[0],
    )) . ':' . $links;
  }
  return $links;
}