book_location

Versions
4.6 – 5
book_location($node, $nodes = array())

Return the path (call stack) to a certain book page.

▾ 4 functions call book_location()

book_block in modules/book.module
Implementation of hook_block().
book_location in modules/book.module
Return the path (call stack) to a certain book page.
book_next in modules/book.module
Fetch the node object of the next page of the book.
theme_book_navigation in modules/book.module
Prepares both the custom breadcrumb trail and the forward/backward navigation for a node presented as a book page.

Code

modules/book.module, line 310

<?php
function book_location($node, $nodes = array()) {
  $parent = db_fetch_object(db_query(db_rewrite_sql('SELECT n.nid, n.title, b.parent, b.weight FROM {node} n INNER JOIN {book} b ON n.nid = b.nid WHERE n.nid = %d'), $node->parent));
  if ($parent->title) {
    $nodes = book_location($parent, $nodes);
    $nodes[] = $parent;
  }
  return $nodes;
}
?>
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.