book_tree
- Versions
- 4.6 – 5
book_tree($parent = 0, $depth = 3, $unfold = array())
Code
modules/book.module, line 562
<?php
function book_tree($parent = 0, $depth = 3, $unfold = array()) {
$result = 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.status = 1 AND n.moderate = 0 ORDER BY b.weight, n.title'));
while ($node = db_fetch_object($result)) {
$list = $children[$node->parent] ? $children[$node->parent] : array();
$list[] = $node;
$children[$node->parent] = $list;
}
if ($tree = book_tree_recurse($parent, $depth, $children, $unfold)) {
return '<div class="menu"><ul>'. $tree .'</ul></div>';
}
}
?>Login or register to post comments 