summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDries Buytaert2009-04-27 07:08:00 (GMT)
committerDries Buytaert2009-04-27 07:08:00 (GMT)
commit18117a43f4cbc7bac9821db76432d0482886b0ff (patch)
treed14f3b4466ea23de4bf490a4276d9bfc56f62cf5
parent8e4022fe6d2a0ab552c690193dfb28413c8ff935 (diff)
- Patch #361529 by j.somers: illogical syntax for book_toc().
-rw-r--r--modules/book/book.module8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/book/book.module b/modules/book/book.module
index d0132e6..888324b 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -401,7 +401,7 @@ function _book_parent_select($book_link) {
'#title' => t('Parent item'),
'#default_value' => $book_link['plid'],
'#description' => t('The parent page in the book. The maximum depth for a book and all child pages is !maxdepth. Some pages in the selected book may not be available as parents if selecting them would exceed this limit.', array('!maxdepth' => MENU_MAX_DEPTH)),
- '#options' => book_toc($book_link['bid'], array($book_link['mlid']), $book_link['parent_depth_limit']),
+ '#options' => book_toc($book_link['bid'], $book_link['parent_depth_limit'], array($book_link['mlid'])),
'#attributes' => array('class' => 'book-title-select'),
);
}
@@ -945,15 +945,15 @@ function _book_toc_recurse($tree, $indent, &$toc, $exclude, $depth_limit) {
*
* @param $bid
* The ID of the book whose pages are to be listed.
+ * @param $depth_limit
+ * Any link deeper than this value will be excluded (along with its children).
* @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).
* @return
* An array of mlid, title pairs for use as options for selecting a book page.
*/
-function book_toc($bid, $exclude = array(), $depth_limit) {
+function book_toc($bid, $depth_limit, $exclude = array()) {
$tree = menu_tree_all_data(book_menu_name($bid));
$toc = array();
_book_toc_recurse($tree, '', $toc, $exclude, $depth_limit);