You are here

function theme_biblio_author_link in Bibliography Module 7.2

Same name and namespace in other branches
  1. 6.2 includes/biblio_theme.inc \theme_biblio_author_link()
  2. 6 biblio_theme.inc \theme_biblio_author_link()
  3. 7 includes/biblio_theme.inc \theme_biblio_author_link()
5 theme calls to theme_biblio_author_link()
biblio_style_apa in styles/biblio_style_apa.inc
Apply a bibliographic style to the node
biblio_style_cse in styles/biblio_style_cse.inc
csl_name::render in modules/CiteProc/CSL.inc
theme_biblio_format_authors in includes/biblio.theme.inc
theme_biblio_long in includes/biblio.theme.inc
DEPRECIATED! this was the original output format which is not to flexable it will be removed TODO: remove this function

File

includes/biblio.theme.inc, line 588

Code

function theme_biblio_author_link($variables) {
  $author = $variables['author'];
  $uri = drupal_parse_url(request_uri());
  if (!isset($uri['attributes'])) {
    $uri['attributes'] = array();
  }
  $path = $uri['path'];
  $uri['path'] = variable_get('biblio_base', 'biblio');
  $uri['query']['f']['author'] = $author->cid;
  if (isset($author->drupal_uid) && $author->drupal_uid > 0) {
    $uri['attributes'] += array(
      'class' => array(
        'biblio-local-author',
      ),
    );
  }
  if (variable_get('biblio_links_target_new_window', null)) {
    $uri['attributes'] += array(
      'target' => '_blank',
    );
    $uri['html'] = TRUE;
  }
  if (variable_get('biblio_author_link_profile', 0) && isset($author['drupal_uid']) && $author['drupal_uid'] > 0) {
    $profile_path = 'user/' . $author->drupal_uid . '/' . $uri['path'];
    if ($path != '/' . $profile_path) {

      // we only create links to the profile page if we are not already on it.
      $uri['path'] = $profile_path;
      unset($uri['query']);
    }
  }
  return l(trim($author->name), $uri['path'], $uri);
}