Book.module: <top-level> item didn't show up in parent selector.

4.5.x
Steven Wittens 2004-08-24 03:22:26 +00:00
parent ad13675a4f
commit cdff29b0ab
2 changed files with 6 additions and 2 deletions

View File

@ -522,13 +522,15 @@ function book_toc($exclude = 0) {
array_push($children[$node->parent], $node);
}
$toc = array();
// If the user is an administrator, add the top-level book page;
// only administrators can start new books.
if (user_access('administer nodes')) {
$toc[0] = '<'. t('top-level') .'>';
}
$toc = book_toc_recurse(0, '', array(), $children, $exclude);
$toc = book_toc_recurse(0, '', $toc, $children, $exclude);
return $toc;
}

View File

@ -522,13 +522,15 @@ function book_toc($exclude = 0) {
array_push($children[$node->parent], $node);
}
$toc = array();
// If the user is an administrator, add the top-level book page;
// only administrators can start new books.
if (user_access('administer nodes')) {
$toc[0] = '<'. t('top-level') .'>';
}
$toc = book_toc_recurse(0, '', array(), $children, $exclude);
$toc = book_toc_recurse(0, '', $toc, $children, $exclude);
return $toc;
}