You are here

function biblio_ris_biblio_export_link in Bibliography Module 7.2

Same name and namespace in other branches
  1. 6.2 modules/RIS/biblio_ris.module \biblio_ris_biblio_export_link()
  2. 7 modules/RIS/biblio_ris.module \biblio_ris_biblio_export_link()

Creates a link to export a node (or view) in ris format

Parameters

$base this is the base url (defaults to /biblio):

$nid the node id, if NULL then the current view is exported:

Return value

a link (<a href=...>ris</a>)

1 call to biblio_ris_biblio_export_link()
biblio_ris_entity_view in modules/RIS/biblio_ris.module

File

modules/RIS/biblio_ris.module, line 93

Code

function biblio_ris_biblio_export_link($nid = NULL, $filter = array()) {
  $show_link = variable_get('biblio_export_links', array(
    'ris' => TRUE,
  ));
  if (!isset($show_link['ris']) || empty($show_link['ris']) || !biblio_access('export')) {
    return array();
  }
  $base = variable_get('biblio_base', 'biblio');
  if (module_exists('popups') && !empty($nid)) {
    $link = array(
      'attributes' => array(
        'class' => 'popups',
        'title' => t("Click to get the RIS output"),
      ),
    );
  }
  else {
    $link = array(
      'attributes' => array(
        'title' => t("Click to download the RIS formatted file"),
      ),
    );
  }
  $link['href'] = "{$base}/export/ris/{$nid}";
  $link['title'] = t('RIS');
  if (empty($nid) && !empty($filter)) {

    // add any filters which may be on the current page
    $link['query'] = $filter;
  }
  return array(
    'biblio_ris' => $link,
  );
}