Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
0ceeee8e
Commit
0ceeee8e
authored
Apr 27, 2010
by
Dries
Browse files
- Patch
#640646
by Caligan: expanded the API documentation of _book_toc_recurse().
parent
ba6d89a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/book/book.module
View file @
0ceeee8e
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment