You are here

function biblio_link in Bibliography Module 5

Same name and namespace in other branches
  1. 6.2 biblio.module \biblio_link()
  2. 6 biblio.module \biblio_link()

Implementation of hook_link().

This is implemented so that an edit link is displayed for users who have the rights to edit a node.

File

./biblio.module, line 141

Code

function biblio_link($type, $node = NULL, $teaser = FALSE) {
  $links = array();
  if ($type == 'node' && $node->type == 'biblio') {

    // Don't display a redundant edit link if they are node administrators.
    if (biblio_access('update', $node) && !user_access('administer nodes')) {
      $links['biblio_edit'] = array(
        'title' => t('edit this entry'),
        'href' => "node/{$node->nid}/edit",
      );
      return $links;
    }
  }
  return;
}