book_link

Versions
4.6 – 4.7
book_link($type, $node = 0, $main = 0)
5 – 6
book_link($type, $node = NULL, $teaser = FALSE)

Implementation of hook_link().

Code

modules/book.module, line 53

<?php
function book_link($type, $node = 0, $main = 0) {

  $links = array();

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

  return $links;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.