From 293a297fe62c89563a40f09a124403c18d42ad07 Mon Sep 17 00:00:00 2001 From: Silvio Date: Wed, 26 Mar 2014 16:55:50 -0300 Subject: Coding style --- taxonomy_node_tree.module | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/taxonomy_node_tree.module b/taxonomy_node_tree.module index 184ec0f..85a60e9 100644 --- a/taxonomy_node_tree.module +++ b/taxonomy_node_tree.module @@ -59,11 +59,11 @@ function taxonomy_node_tree_parents($vid) { function taxonomy_node_tree_index($nodes, $terms) { while ($node = db_fetch_object($nodes)) { foreach ($terms as $term) { - // add nodes into the term + // Add nodes into the term if ($node->tid == $term->tid) { $term->nodes[] = $node; } - // update an index of terms + // Update an index of terms $tree[$term->tid] = $term; } } @@ -96,6 +96,7 @@ function taxonomy_node_tree_relation($tree) { } } } + return $tree; } @@ -112,13 +113,14 @@ function taxonomy_node_tree_relation($tree) { */ function taxonomy_node_tree_sort(&$tree, $term) { if ($term->parents[0] != 0 && isset($tree[$term->parents[0]])) { - // is child + // Is child if (isset($term->children)) { // is also parent, so go down one level foreach ($term->children as $child) { taxonomy_node_tree_sort($tree, $tree[$child]); } } + $tree[$term->parents[0]]->below[] = drupal_clone($term); unset($tree[$term->tid]); } @@ -139,6 +141,7 @@ function taxonomy_node_tree_hierarchy($tree) { taxonomy_node_tree_sort($tree, $term); } } + return $tree; } @@ -398,7 +401,6 @@ function taxonomy_node_tree_theme() { * Rendered HTML tree. */ function theme_taxonomy_node_tree_list($term, $id, $class, $baselink = NULL, $level = NULL, $active_link = NULL) { - if ($level == NULL) { $level = 0; } -- cgit v1.2.3