From cf7ff05265920cc11df3fb27848903de7b6651ef Mon Sep 17 00:00:00 2001 From: Silvio Date: Fri, 16 Oct 2009 11:22:28 -0300 Subject: More integration with taxonomy_node_tree --- jquery_drawer.module | 76 ++++++---------------------------------------------- 1 file changed, 8 insertions(+), 68 deletions(-) diff --git a/jquery_drawer.module b/jquery_drawer.module index 76e0856..dd73f27 100644 --- a/jquery_drawer.module +++ b/jquery_drawer.module @@ -49,8 +49,10 @@ function jquery_drawer_block($op = 'list', $delta = 0, $edit = array()) { break; case 'view': - $menu = explode(':', variable_get('jquery_drawer', '1')); - $block['content'] = theme('jquery_drawer', $menu[0], $menu[1]); + // Get all terms from a given vocabulary + $vid = variable_get('jquery_drawer', '1'); + $menu = taxonomy_node_tree_parents($vid); + $block['content'] = theme('jquery_drawer', $menu); return $block; } } @@ -77,7 +79,6 @@ function jquery_drawer_theme() { 'jquery_drawer' => array( 'arguments' => array( 'menu' => NULL, - 'parent' => NULL, ), ), 'jquery_drawer_javascript' => array( @@ -94,33 +95,12 @@ function jquery_drawer_theme() { /** * Drawer logic. - */ -function theme_jquery_drawer() { - // Get all terms from a given vocabulary - $vocabulary = variable_get('jquery_drawer', '1'); - $terms = jquery_drawer_taxonomy_get_tree($vocabulary); - - foreach ($terms as $term) { - // Just show parent terms - if (taxonomy_get_parents($term->tid) == array()) { - $menu[] = $term; - } - } - - // Build the drawer - $output = jquery_drawer_build($menu); - return $output; -} - -/** - * Drawer rendering. - * * @ingroup themeable */ -function jquery_drawer_build($menu) { +function theme_jquery_drawer($menu) { $output = '