You are here

function book_toc_recurse in Drupal 5

Same name and namespace in other branches
  1. 4 modules/book.module \book_toc_recurse()

This is a helper function for book_toc().

1 call to book_toc_recurse()
book_toc in modules/book/book.module
Returns an array of titles and nid entries of book pages in table of contents order.

File

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

Code

function book_toc_recurse($nid, $indent, $toc, $children, $exclude) {
  if ($children[$nid]) {
    foreach ($children[$nid] as $foo => $node) {
      if (!$exclude || $exclude != $node->nid) {
        $toc[$node->nid] = $indent . ' ' . $node->title;
        $toc = book_toc_recurse($node->nid, $indent . '--', $toc, $children, $exclude);
      }
    }
  }
  return $toc;
}