book_admin_view_book

Versions
4.6
book_admin_view_book($nid, $depth = 1)

▾ 3 functions call book_admin_view_book()

book_admin_orphan in modules/book.module
Menu callback; displays a listing of all orphaned book pages.
book_admin_view in modules/book.module
Display an administrative view of the hierarchy of a book.
book_admin_view_book in modules/book.module

Code

modules/book.module, line 675

<?php
function book_admin_view_book($nid, $depth = 1) {
  $result = db_query(db_rewrite_sql('SELECT n.nid, b.weight, n.title FROM {node} n INNER JOIN {book} b ON n.nid = b.nid WHERE b.parent = %d ORDER BY b.weight, n.title'), $nid);

  $rows = array();

  while ($node = db_fetch_object($result)) {
    $node = node_load(array('nid' => $node->nid));
    $rows[] = book_admin_view_line($node, $depth);
    $rows = array_merge($rows, book_admin_view_book($node->nid, $depth + 1));
  }

  return $rows;
}
?>
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.