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
7d3d5532
Commit
7d3d5532
authored
Apr 07, 2005
by
Dries
Browse files
- Fixed warning.
parent
6ba8f32c
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/taxonomy.module
View file @
7d3d5532
...
...
@@ -624,16 +624,18 @@ function taxonomy_get_tree($vid, $parent = 0, $depth = -1, $max_depth = NULL) {
}
$max_depth
=
(
is_null
(
$max_depth
))
?
count
(
$children
[
$vid
])
:
$max_depth
;
foreach
(
$children
[
$vid
][
$parent
]
as
$child
)
{
if
(
$max_depth
>
$depth
)
{
$terms
[
$vid
][
$child
]
->
depth
=
$depth
;
// The "parent" attribute is not useful, as it would show one parent only.
unset
(
$terms
[
$vid
][
$child
]
->
parent
);
$terms
[
$vid
][
$child
]
->
parents
=
$parents
[
$vid
][
$child
];
$tree
[]
=
$terms
[
$vid
][
$child
];
if
(
$children
[
$vid
][
$child
])
{
$tree
=
array_merge
(
$tree
,
taxonomy_get_tree
(
$vid
,
$child
,
$depth
,
$max_depth
));
if
(
$children
[
$vid
][
$parent
])
{
foreach
(
$children
[
$vid
][
$parent
]
as
$child
)
{
if
(
$max_depth
>
$depth
)
{
$terms
[
$vid
][
$child
]
->
depth
=
$depth
;
// The "parent" attribute is not useful, as it would show one parent only.
unset
(
$terms
[
$vid
][
$child
]
->
parent
);
$terms
[
$vid
][
$child
]
->
parents
=
$parents
[
$vid
][
$child
];
$tree
[]
=
$terms
[
$vid
][
$child
];
if
(
$children
[
$vid
][
$child
])
{
$tree
=
array_merge
(
$tree
,
taxonomy_get_tree
(
$vid
,
$child
,
$depth
,
$max_depth
));
}
}
}
}
...
...
modules/taxonomy/taxonomy.module
View file @
7d3d5532
...
...
@@ -624,16 +624,18 @@ function taxonomy_get_tree($vid, $parent = 0, $depth = -1, $max_depth = NULL) {
}
$max_depth
=
(
is_null
(
$max_depth
))
?
count
(
$children
[
$vid
])
:
$max_depth
;
foreach
(
$children
[
$vid
][
$parent
]
as
$child
)
{
if
(
$max_depth
>
$depth
)
{
$terms
[
$vid
][
$child
]
->
depth
=
$depth
;
// The "parent" attribute is not useful, as it would show one parent only.
unset
(
$terms
[
$vid
][
$child
]
->
parent
);
$terms
[
$vid
][
$child
]
->
parents
=
$parents
[
$vid
][
$child
];
$tree
[]
=
$terms
[
$vid
][
$child
];
if
(
$children
[
$vid
][
$child
])
{
$tree
=
array_merge
(
$tree
,
taxonomy_get_tree
(
$vid
,
$child
,
$depth
,
$max_depth
));
if
(
$children
[
$vid
][
$parent
])
{
foreach
(
$children
[
$vid
][
$parent
]
as
$child
)
{
if
(
$max_depth
>
$depth
)
{
$terms
[
$vid
][
$child
]
->
depth
=
$depth
;
// The "parent" attribute is not useful, as it would show one parent only.
unset
(
$terms
[
$vid
][
$child
]
->
parent
);
$terms
[
$vid
][
$child
]
->
parents
=
$parents
[
$vid
][
$child
];
$tree
[]
=
$terms
[
$vid
][
$child
];
if
(
$children
[
$vid
][
$child
])
{
$tree
=
array_merge
(
$tree
,
taxonomy_get_tree
(
$vid
,
$child
,
$depth
,
$max_depth
));
}
}
}
}
...
...
Write
Preview
Supports
Markdown
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