aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--taxonomy_node_tree.module10
1 files changed, 8 insertions, 2 deletions
diff --git a/taxonomy_node_tree.module b/taxonomy_node_tree.module
index ebb9e3c..c34c8ea 100644
--- a/taxonomy_node_tree.module
+++ b/taxonomy_node_tree.module
@@ -223,9 +223,10 @@ function taxonomy_node_tree_list($term, $id, $class, $baselink = NULL, &$level =
$level++;
if (isset($term->tid)) {
- $output .= '<li>';
- $output .= $term->name;
+ $output = '<li>';
+
if (isset($term->below)) {
+ $output .= $term->name;
$output .= '<ul id="' . $id .'-ul-'. $level .'" class="'. $class .'">';
foreach ($term->below as $child) {
$output .= taxonomy_node_tree_list($child, $id, $class, $baselink, $level);
@@ -233,6 +234,7 @@ function taxonomy_node_tree_list($term, $id, $class, $baselink = NULL, &$level =
$output .= '</ul>';
}
elseif (isset($term->nodes)) {
+ $output .= $term->name;
$output .= '<ul id="' . $id .'-ul-'. $level .'" class="'. $class .'">';
foreach ($term->nodes as $node) {
$output .= '<li>';
@@ -241,6 +243,10 @@ function taxonomy_node_tree_list($term, $id, $class, $baselink = NULL, &$level =
}
$output .= '</ul>';
}
+ else {
+ $output .= '<span>'. $term->name .'</span>';
+ }
+
$output .= '</li>';
}