diff options
author | Silvio <s1lv10@uol.com.br> | 2009-10-03 18:08:08 -0300 |
---|---|---|
committer | Silvio <s1lv10@uol.com.br> | 2009-10-03 18:08:08 -0300 |
commit | a6de1b6cdb31e96418cc1a9328b0d34378c488f3 (patch) | |
tree | 602af349e1543958b2dc0b9f3005c8287220cf82 | |
parent | ae76dc7f4aa127123a16264b559a1603c3fefa5d (diff) | |
download | finder_menu-a6de1b6cdb31e96418cc1a9328b0d34378c488f3.tar.gz finder_menu-a6de1b6cdb31e96418cc1a9328b0d34378c488f3.tar.bz2 |
Fixing finder_menu_build()
-rw-r--r-- | finder_menu.module | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/finder_menu.module b/finder_menu.module index 6857987..7191228 100644 --- a/finder_menu.module +++ b/finder_menu.module @@ -110,7 +110,7 @@ function theme_finder_menu($menu_name, $mlid) { // Build the menus $output = '<div id="finderparent">'; - $output .= finder_menu_build($menu, "finder"); + $output .= finder_menu_build($menu); $output .= '</div>'; drupal_add_js(drupal_get_path('module', 'finder_menu') .'/finder_menu.js'); @@ -122,14 +122,15 @@ function theme_finder_menu($menu_name, $mlid) { * * @ingroup themeable */ -function finder_menu_build($menu, $id = null) { +function finder_menu_build($menu) { - if ($id == "finder") { + global $finder_menu_id; + + if ($finder_menu_id == null) { $output = '<ul id="finder">'; - $id = 0; + $finder_menu_id = 0; } else { - $id = ($id == null) ? 0: $id; - $output = '<ul id="finder[ul][' . $id . ']">'; + $output = '<ul id="finder[ul][' . $finder_menu_id . ']">'; } foreach ($menu as $menu_item) { @@ -137,7 +138,8 @@ function finder_menu_build($menu, $id = null) { $output .= '<li>'; if ($menu_item['below'] !== FALSE && finder_menu_has_unhidden_submenu($menu_item['below'])) { $output .= $menu_item['link']['title']; - $output .= finder_menu_build($menu_item['below'], ++$id); + $finder_menu_id++; + $output .= finder_menu_build($menu_item['below']); } else { $output .= theme('menu_item_link', $menu_item['link']); } |