summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/book.module4
-rw-r--r--modules/book/book.module4
2 files changed, 6 insertions, 2 deletions
diff --git a/modules/book.module b/modules/book.module
index d62d33f90..b84c0df99 100644
--- a/modules/book.module
+++ b/modules/book.module
@@ -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;
}
diff --git a/modules/book/book.module b/modules/book/book.module
index d62d33f90..b84c0df99 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -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;
}