? dhtml_menu.theme.inc
Index: dhtml_menu.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/dhtml_menu/dhtml_menu.js,v
retrieving revision 1.27
diff -u -p -r1.27 dhtml_menu.js
--- dhtml_menu.js 31 May 2009 07:18:55 -0000 1.27
+++ dhtml_menu.js 31 May 2009 10:56:38 -0000
@@ -40,7 +40,7 @@ Drupal.behaviors.dhtmlMenu = {
* only the latter element, so we must use siblings() to get
* back to the link element.
*/
- $('ul.menu li.dhtml-menu:not(.leaf,.no-dhtml)').each(function() {
+ $('ul.menu li.dhtml-menu:not(.leaf)').each(function() {
if (nav == 'pseudo-child') {
var ul = $(this).find('ul:first');
if (ul.length) {
Index: dhtml_menu.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/dhtml_menu/dhtml_menu.module,v
retrieving revision 1.41
diff -u -p -r1.41 dhtml_menu.module
--- dhtml_menu.module 31 May 2009 07:18:55 -0000 1.41
+++ dhtml_menu.module 31 May 2009 10:56:38 -0000
@@ -51,23 +51,25 @@ function dhtml_menu_theme_menu_item_link
$function = isset($registry[$theme]) && drupal_function_exists($registry[$theme]['menu_item_link']) ? $registry[$theme]['menu_item_link'] : 'theme_menu_item_link';
}
- // TODO: Find out why options sometimes are serialized. Fix this workaround before D7 release!
- if (!isset($link['localized_options']) || !is_array($link['localized_options'])) {
- $link['localized_options'] = array('attributes' => '');
- }
-
- if (!isset($link['menu_name']) || !isset($link['mlid']) || !empty($disabled[$link['menu_name']])) {
- $link['dhtml_disabled'] = TRUE;
+ // Do not stack items that have no menu or mlid.
+ if (empty($link['menu_name']) || empty($link['mlid'])) {
return $function($link);
}
- $link['localized_options']['attributes']['id'] = 'dhtml_menu-' . _dhtml_menu_unique_id($link['mlid']);
+ $extended_link = $link;
+
+ // If the type is a blacklist, disable it if it's listed, otherwise disable it if it's not listed.
+ $extended_link['dhtml_disabled'] = ($settings['filter']['type'] == 'blacklist') == !empty($settings['filter']['list'][$link['menu_name']]);
- // Each link in series is another level of recursion. Add it to the stack.
- _dhtml_menu_stack($link);
+ // Add the ID attribute.
+ $extended_link = array_merge_recursive($extended_link, array('localized_options' => array('attributes' => array())));
+ $extended_link['id'] => 'dhtml_menu-' . _dhtml_menu_unique_id($link['mlid']);
- // Pass the altered variables to the normal menu themer.
- return $function($link);
+ // Each link in series is another level of recursion. Add it to the stack, even if it is disabled.
+ _dhtml_menu_stack($extended_link);
+
+ // Pass the altered variables to the normal menu themer, but only if DHTML should be used.
+ return $function(empty($extended_link['dhtml_disabled']) ? $extended_link : $link);
}
/**
@@ -96,14 +98,11 @@ function dhtml_menu_theme_menu_item($lin
// If this item should not have DHTML, then return to the "parent" function.
$current = current($stack);
if (!empty($current['dhtml_disabled'])) {
- $extra_class .= ' no-dhtml ';
-
return $function($link, $has_children, $menu, $in_active_trail, $extra_class);
}
- else {
- $extra_class .= ' dhtml-menu ';
- }
-
+
+ $extra_class .= ' dhtml-menu ';
+
// If there are children, but they were not loaded...
if ($has_children && !$menu) {
// Load the tree below the current position.