book_node_view_link

Versions
mediamosa-21
book_node_view_link($node, $view_mode)

Inject links into $node as needed.

Code

modules/book/book.module, line 89

<?php
function book_node_view_link($node, $view_mode) {
  $links = array();

  if (isset($node->book['depth'])) {
    if ($view_mode == 'full') {
      $child_type = variable_get('book_child_type', 'book');
      if ((user_access('add content to books') || user_access('administer book outlines')) && node_access('create', $child_type) && $node->status == 1 && $node->book['depth'] < MENU_MAX_DEPTH) {
        $links['book_add_child'] = array(
          'title' => t('Add child page'),
          'href' => 'node/add/' . str_replace('_', '-', $child_type),
          'query' => array('parent' => $node->book['mlid']),
        );
      }

      if (user_access('access printer-friendly version')) {
        $links['book_printer'] = array(
          'title' => t('Printer-friendly version'),
          'href' => 'book/export/html/' . $node->nid,
          'attributes' => array('title' => t('Show a printer-friendly version of this book page and its sub-pages.'))
        );
      }
    }
  }

  if (!empty($links)) {
    $node->content['links']['book'] = array(
      '#theme' => 'links__book_node',
      '#links' => $links,
      '#attributes' => array('class' => array('links', 'inline')),
    );
  }
}
?>