book_toc_recurse

Definition

book_toc_recurse($nid, $indent, $toc, $children, $exclude)
modules/book/book.module, line 517

Description

This is a helper function for book_toc().

Code

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

Drupal is a registered trademark of Dries Buytaert.