Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
220
Merge Requests
220
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
71da8e0a
Commit
71da8e0a
authored
Jan 01, 2002
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fixed a small glitch in book_tree()
parent
d85e45bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
modules/book.module
modules/book.module
+6
-2
modules/book/book.module
modules/book/book.module
+6
-2
No files found.
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