From 92a55ddd433cf36665444cb130ce300442cf9a7a Mon Sep 17 00:00:00 2001 From: Silvio Date: Fri, 16 Oct 2009 11:02:01 -0300 Subject: Starting to use taxonomy_node_tree module --- jquery_drawer.info | 2 +- jquery_drawer.module | 38 +------------------------------------- 2 files changed, 2 insertions(+), 38 deletions(-) diff --git a/jquery_drawer.info b/jquery_drawer.info index 9a55330..964b777 100644 --- a/jquery_drawer.info +++ b/jquery_drawer.info @@ -3,4 +3,4 @@ name = jQuery Drawer description = Show menu with jQuery.drawer functionality. core = 6.x version = "6.x-0.1" -dependencies[] = menu +dependencies[] = menu taxonomy_node_tree diff --git a/jquery_drawer.module b/jquery_drawer.module index 276c162..76e0856 100644 --- a/jquery_drawer.module +++ b/jquery_drawer.module @@ -164,29 +164,7 @@ function jquery_drawer_page($tid = null) { AND node.status = "1"'; $result = db_query(db_rewrite_sql($query), implode(',', $filter)); - - while ($node = db_fetch_object($result)) { - foreach ($terms as $term) { - // add nodes into the term - if ($node->tid == $term->tid) { - $term->nodes[] = $node; - } - // update an index of terms - $tree[$term->tid] = $term; - } - } - - // add children relationship just for terms present in the tree - foreach ($tree as $term) { - if ($term->parents[0] != 0 && isset($tree[$term->parents[0]])) { - $tree[$term->parents[0]]->children[] = $term->tid; - } - } - - // build menu with hierarchy - foreach ($tree as $term) { - jquery_drawer_build_tree($tree, $term); - } + $tree = taxonomy_node_tree_build($result, $terms); // format output $output .= '