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
71da8e0a
Commit
71da8e0a
authored
Jan 01, 2002
by
Dries
Browse files
- Fixed a small glitch in book_tree()
parent
d85e45bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/book.module
View file @
71da8e0a
...
...
@@ -454,11 +454,14 @@ function book_toc($parent = 0, $indent = "", $toc = array()) {
function
book_tree_recurse
(
$nid
,
$depth
,
$children
)
{
if
(
$depth
>
1
)
{
if
(
$depth
>
0
)
{
if
(
$children
[
$nid
])
{
foreach
(
$children
[
$nid
]
as
$foo
=>
$node
)
{
$output
.
=
"<li><a href=
\"
node.php?id=
$node->nid
\"
>"
.
check_output
(
$node
->
title
)
.
"</a></li>"
;
$output
.
=
book_tree_recurse
(
$node
->
nid
,
$depth
-
1
,
$children
);
if
(
$tree
=
book_tree_recurse
(
$node
->
nid
,
$depth
-
1
,
$children
))
{
$output
.
=
"<ul>
$tree
</ul>"
;
}
}
}
}
...
...
@@ -476,6 +479,7 @@ function book_tree($parent = 0, $depth = 3) {
array_push
(
$list
,
$node
);
$children
[
$node
->
parent
]
=
$list
;
}
$output
=
book_tree_recurse
(
$parent
,
$depth
,
$children
);
$output
=
"<ul>
$output
</ul>"
;
...
...
modules/book/book.module
View file @
71da8e0a
...
...
@@ -454,11 +454,14 @@ function book_toc($parent = 0, $indent = "", $toc = array()) {
function
book_tree_recurse
(
$nid
,
$depth
,
$children
)
{
if
(
$depth
>
1
)
{
if
(
$depth
>
0
)
{
if
(
$children
[
$nid
])
{
foreach
(
$children
[
$nid
]
as
$foo
=>
$node
)
{
$output
.
=
"<li><a href=
\"
node.php?id=
$node->nid
\"
>"
.
check_output
(
$node
->
title
)
.
"</a></li>"
;
$output
.
=
book_tree_recurse
(
$node
->
nid
,
$depth
-
1
,
$children
);
if
(
$tree
=
book_tree_recurse
(
$node
->
nid
,
$depth
-
1
,
$children
))
{
$output
.
=
"<ul>
$tree
</ul>"
;
}
}
}
}
...
...
@@ -476,6 +479,7 @@ function book_tree($parent = 0, $depth = 3) {
array_push
(
$list
,
$node
);
$children
[
$node
->
parent
]
=
$list
;
}
$output
=
book_tree_recurse
(
$parent
,
$depth
,
$children
);
$output
=
"<ul>
$output
</ul>"
;
...
...
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