You are here

function theme_google_scholar_link in Bibliography Module 7.2

Same name and namespace in other branches
  1. 6.2 includes/biblio_theme.inc \theme_google_scholar_link()
  2. 7 includes/biblio_theme.inc \theme_google_scholar_link()
2 theme calls to theme_google_scholar_link()
biblio_node_view in ./biblio.module
Implements hook_node_view
theme_biblio_export_links in includes/biblio.theme.inc
Creates a group of links for the various export functions

File

includes/biblio.theme.inc, line 947

Code

function theme_google_scholar_link($variables) {
  $node = $variables['node'];
  $query = array();
  $query['btnG'] = 'Search+Scholar';
  $query['as_q'] = '"' . str_replace(array(
    ' ',
    '(',
    ')',
  ), array(
    '+',
  ), $node->title) . '"';

  // as_q = all the words
  if (isset($node->biblio_contributors[0]['lastname'])) {
    $query['as_sauthors'] = $node->biblio_contributors[0]['lastname'];
  }
  $query['as_occt'] = 'any';
  $query['as_epq'] = '';

  // exact phrase
  $query['as_oq'] = '';

  // at least one of the words
  $query['as_eq'] = '';

  // without the words
  $query['as_publication'] = '';

  // published in
  $query['as_ylo'] = '';

  // lower date in date range
  $query['as_yhi'] = '';

  // upper date in date range
  $query['as_sdtAAP'] = 1;

  //Search articles in all subject areas
  $query['as_sdtp'] = 1;

  //include patents
  $attrs = array(
    'title' => t("Click to search Google Scholar for this entry"),
  );
  if (variable_get('biblio_links_target_new_window', NULL)) {
    $attrs = array_merge($attrs, array(
      'target ' => '_blank',
    ));
  }
  return array(
    'title' => t('Google Scholar'),
    'href' => 'http://scholar.google.com/scholar',
    'attributes' => $attrs,
    'query' => $query,
  );
}