book_toc_recurse

Versions
4.6 – 5
book_toc_recurse($nid, $indent, $toc, $children, $exclude)

This is a helper function for book_toc().

▾ 2 functions call book_toc_recurse()

book_toc in modules/book.module
Returns an array of titles and nid entries of book pages in table of contents order.
book_toc_recurse in modules/book.module
This is a helper function for book_toc().

Code

modules/book.module, line 542

<?php
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;
}
?>
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.