diff options
author | Silvio <s1lv10@uol.com.br> | 2009-10-15 18:08:22 -0300 |
---|---|---|
committer | Silvio <s1lv10@uol.com.br> | 2009-10-15 18:08:22 -0300 |
commit | e2c972434076664f5ee98844d9ecb6e347b8d15a (patch) | |
tree | 397a44973d7d5bfda95d9d53348cc71b230b53c6 | |
parent | 5ec7483e61c4eda76f5c2146829aef05a8f255aa (diff) | |
download | taxonomy_node_tree-e2c972434076664f5ee98844d9ecb6e347b8d15a.tar.gz taxonomy_node_tree-e2c972434076664f5ee98844d9ecb6e347b8d15a.tar.bz2 |
Starting to work
-rw-r--r-- | taxonomy_node_tree.module | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/taxonomy_node_tree.module b/taxonomy_node_tree.module index 3f6bc32..40d71dc 100644 --- a/taxonomy_node_tree.module +++ b/taxonomy_node_tree.module @@ -47,27 +47,28 @@ function taxonomy_node_tree_build($menu) { /** * Menu callback. */ -function taxonomy_node_tree_page($tid = null) { +function taxonomy_render_tree($tid = 0, $vid) { // First render all nodes whose parent is $term + if ($tid != 0) { - $output = ''; - $nodes = taxonomy_select_nodes(array($tid)); - - while ($node = db_fetch_object($nodes)) { - $link['title'] = $node->title; - $link['href'] = 'node/' . $node->nid; - $output .= theme('taxonomy_node_tree_link', $link); + $output = ''; + $nodes = taxonomy_select_nodes(array($tid)); + + while ($node = db_fetch_object($nodes)) { + $link['title'] = $node->title; + $link['href'] = 'node/' . $node->nid; + $output .= theme('taxonomy_node_tree_link', $link); + } } - // Then render all nodes whose terms are children of $term - - $vocabulary = variable_get('taxonomy_node_tree', '1'); - $terms = taxonomy_node_tree_taxonomy_get_tree($vocabulary, $tid); + // Render other child nodes + $terms = taxonomy_node_tree_taxonomy_get_tree($vid, $tid); foreach ($terms as $term) { $filter[] = $term->tid; } + // TODO: continue from here $query = 'SELECT node.nid, node.title, term_node.tid FROM {node} LEFT JOIN {term_node} ON term_node.nid = node.nid WHERE term_node.tid IN (%s) AND node.status = "1"'; |