function _biblio_format_author in Bibliography Module 7.2
Same name and namespace in other branches
- 6.2 includes/biblio.pages.inc \_biblio_format_author()
- 6 biblio.pages.inc \_biblio_format_author()
- 7 includes/biblio.pages.inc \_biblio_format_author()
1 call to _biblio_format_author()
- _biblio_format_author_page in includes/
biblio.pages.inc
File
- includes/
biblio.pages.inc, line 1298
Code
function _biblio_format_author($author) {
if ($author->literal) {
$name = $author->name;
}
else {
$name = $author->lastname;
$name .= !empty($author->firstname) ? ', ' . drupal_substr($author->firstname, 0, 1) . '.' : (!empty($author->initials) ? ', ' . $author->initials : '');
}
$uri['path'] = variable_get('biblio_base', 'biblio');
$uri['query']['f']['author'] = $author->cid;
$uri['attributes'] = array();
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;
}
$name = l(trim($name), $uri['path'], $uri);
// $format = biblio_format_authors(array($author));
$name .= ' (' . $author->cnt . ') ' . (biblio_access('edit_author') ? _biblio_author_edit_links($author) : '');
if (biblio_access('edit_author') && isset($author->suspect)) {
$name = '<div class="suspect">' . $name . '</div>';
}
return $name;
}