aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@socioambiental.org>2014-03-26 16:55:50 -0300
committerSilvio <silvio@socioambiental.org>2014-03-26 16:55:50 -0300
commit293a297fe62c89563a40f09a124403c18d42ad07 (patch)
tree5522da368528e1f1aaefbb087a47f2edb309b3e8
parentabb091f8906bf6f98d95e54fbe302c41b7722e27 (diff)
downloadtaxonomy_node_tree-293a297fe62c89563a40f09a124403c18d42ad07.tar.gz
taxonomy_node_tree-293a297fe62c89563a40f09a124403c18d42ad07.tar.bz2
Coding styleHEADmasterdevelop
-rw-r--r--taxonomy_node_tree.module10
1 files 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;
}