function book_link
6.x book.module | book_link($type, $node = NULL, $teaser = FALSE) |
Implementation of hook_link().
2 string references to 'book_link'
- book_theme in drupal-6.x/
modules/ book/ book.module - Implementation of hook_theme()
- template_preprocess_book_navigation in drupal-6.x/
modules/ book/ book.module - Process variables for book-navigation.tpl.php.
File
- drupal-6.x/
modules/ book/ book.module, line 48 - Allows users to structure the pages of a site in a hierarchy or outline.
Code
function book_link($type, $node = NULL, $teaser = FALSE) {
$links = array();
if ($type == 'node' && isset($node->book)) {
if (!$teaser) {
$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' => "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.'))
);
}
}
}
return $links;
}