You are here

function book_link in Drupal 4

Same name and namespace in other branches
  1. 5 modules/book/book.module \book_link()
  2. 6 modules/book/book.module \book_link()

Implementation of hook_link().

File

modules/book.module, line 53
Allows users to collaboratively author a book.

Code

function book_link($type, $node = 0, $main = 0) {
  $links = array();
  if ($type == 'node' && isset($node->parent)) {
    if (!$main) {
      if (book_access('create', $node) && $node->status == 1) {
        $links[] = l(t('add child page'), "node/add/book/parent/{$node->nid}");
      }
      if (user_access('see printer-friendly version')) {
        $links[] = l(t('printer-friendly version'), 'book/export/html/' . $node->nid, array(
          'title' => t('Show a printer-friendly version of this book page and its sub-pages.'),
        ));
      }
    }
  }
  return $links;
}