aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--finder_menu.module16
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']);
}