aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@devlet.com.br>2011-04-14 18:29:12 -0300
committerSilvio <silvio@devlet.com.br>2011-04-14 18:29:12 -0300
commitf9efcc27594d055093858a2da8c4400ffe8dbf08 (patch)
tree3ae3f1a13918800345c004d7fefdbc157cbec9e9
parente6ec90e1833dd7b89270b9db7d6e2527c0ce7e5f (diff)
downloadtaxonomy_node_tree-f9efcc27594d055093858a2da8c4400ffe8dbf08.tar.gz
taxonomy_node_tree-f9efcc27594d055093858a2da8c4400ffe8dbf08.tar.bz2
Add a span element to nodes without children or links
-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>';
}