Revision a8cee257
Added by Assos Assos almost 5 years ago
drupal7/sites/all/modules/dhtml_menu/dhtml_menu.theme.inc | ||
---|---|---|
1 | 1 |
<?php |
2 |
// $Id: dhtml_menu.theme.inc,v 1.14 2009/11/12 21:47:59 arancaytar Exp $ |
|
3 | 2 |
|
4 | 3 |
|
5 | 4 |
/** |
... | ... | |
29 | 28 |
$l = &$variables['element']['#original_link']; |
30 | 29 |
|
31 | 30 |
// Determine if the menu is blacklisted or not whitelisted. |
32 |
$disabled = ($settings['filter']['type'] == 'blacklist') == !empty($settings['filter']['list'][$l['menu_name']]); |
|
33 |
if (empty($l['menu_name']) || empty($l['mlid']) || $disabled) { |
|
34 |
return; |
|
31 |
// First check menu blocks. |
|
32 |
if (!empty($variables['element']['#bid']['module']) && |
|
33 |
!empty($variables['element']['#bid']['delta']) && |
|
34 |
$variables['element']['#bid']['module'] == 'menu_block') { |
|
35 |
$checked = !empty($settings['filter']['menu_block']['menu_block_' . $variables['element']['#bid']['delta']]); |
|
36 |
if ($checked == ($settings['filter']['type'] == 'blacklist')) { |
|
37 |
// This menu block is either blacklisted, or not whitelisted, hence it is disabled. |
|
38 |
return; |
|
39 |
} |
|
40 |
} |
|
41 |
// Then check menus. |
|
42 |
else { |
|
43 |
$disabled = ($settings['filter']['type'] == 'blacklist') == !empty($settings['filter']['list'][$l['menu_name']]); |
|
44 |
if (empty($l['menu_name']) || empty($l['mlid']) || $disabled) { |
|
45 |
return; |
|
46 |
} |
|
35 | 47 |
} |
36 | 48 |
|
37 | 49 |
// Add the ID and class attributes. |
... | ... | |
46 | 58 |
|
47 | 59 |
// If the current item can expand, and is neither saved as open nor in the active trail, close it. |
48 | 60 |
if ($l['has_children'] && !$l['in_active_trail'] && !in_array($variables['element']['#attributes']['id'], $cookie)) { |
49 |
$variables['element']['#attributes']['class'][] = 'collapsed'; |
|
50 |
$variables['element']['#attributes']['class'][] = 'start-collapsed'; |
|
61 |
if (!in_array('collapsed', $variables['element']['#attributes']['class'])) { |
|
62 |
$variables['element']['#attributes']['class'][] = 'collapsed'; |
|
63 |
} |
|
64 |
if (!in_array('start-collapsed', $variables['element']['#attributes']['class'])) { |
|
65 |
$variables['element']['#attributes']['class'][] = 'start-collapsed'; |
|
66 |
} |
|
51 | 67 |
} |
52 | 68 |
} |
53 | 69 |
|
Also available in: Unified diff
Weekly update of contrib modules