summaryrefslogtreecommitdiff
path: root/modules/book
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-04-27 10:02:07 +0000
committerDries Buytaert <dries@buytaert.net>2010-04-27 10:02:07 +0000
commit0ceeee8e97d4063ef397defb11efa52881e3a230 (patch)
tree3ad804b694ec836a7790298806aa9478b63bbe8e /modules/book
parentba6d89a4048bc3faa81da30b2309baf299bb5011 (diff)
downloadbrdo-0ceeee8e97d4063ef397defb11efa52881e3a230.tar.gz
brdo-0ceeee8e97d4063ef397defb11efa52881e3a230.tar.bz2
- Patch #640646 by Caligan: expanded the API documentation of _book_toc_recurse().
Diffstat (limited to 'modules/book')
-rw-r--r--modules/book/book.module21
1 files changed, 20 insertions, 1 deletions
diff --git a/modules/book/book.module b/modules/book/book.module
index 31401958f..ab09be7c7 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -1019,7 +1019,26 @@ function template_preprocess_book_navigation(&$variables) {
}
/**
- * A recursive helper function for book_toc().
+ * Recursively processes and formats menu items for book_toc().
+ *
+ * This helper function recursively modifies the $toc array for each item in
+ * $tree, ignoring items in the exclude array or at a depth greater than the
+ * limit. Truncates titles over thirty characters and appends an indentation
+ * string incremented by depth.
+ *
+ * @param $tree
+ * The data structure of the book's menu tree. Includes hidden links.
+ * @param $indent
+ * A string appended to each menu item title. Increments by '--' per depth
+ * level.
+ * @param $toc
+ * Reference to the table of contents array. This is modified in place, so the
+ * function does not have a return value.
+ * @param $exclude
+ * Optional array of mlid values. Any link whose mlid is in this array will be
+ * excluded (along with its children).
+ * @param $depth_limit
+ * Any link deeper than this value will be excluded (along with its children).
*/
function _book_toc_recurse($tree, $indent, &$toc, $exclude, $depth_limit) {
foreach ($tree as $data) {