You are here

function theme_google_scholar_link in Bibliography Module 6.2

Same name and namespace in other branches
  1. 7 includes/biblio_theme.inc \theme_google_scholar_link()
  2. 7.2 includes/biblio.theme.inc \theme_google_scholar_link()

Parameters

object $node:

2 theme calls to theme_google_scholar_link()
biblio_link in ./biblio.module
Implements hook_link().
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 1109

Code

function theme_google_scholar_link($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[1])) {
    $query['as_sauthors'] = $node->biblio_contributors[1][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,
  );
}