Skip to content

Commit

Permalink
[gh-592] Fix a bug where menu items deeper than two levels would be s…
Browse files Browse the repository at this point in the history
…hown sometimes and rename drill_down setting to disable_drill_down for better code comprehension.
  • Loading branch information
tsteiner committed Feb 8, 2013
1 parent 977c606 commit cc259d5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 6 additions & 7 deletions template.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@ function unl_wdn_block_view_alter(&$data, $block) {
*/
function _unl_wdn_block_view_system_main_menu_alter(&$data, $block) {
$current_menu_link = _unl_wdn_get_current_menu_link();
if (!$current_menu_link) {
return;
}
$submenu = _unl_wdn_get_current_submenu($data['content'], $current_menu_link->mlid);
if (!theme_get_setting('drill_down') && $submenu && $submenu['#original_link']['depth'] > 1) {
$data['content'] = $submenu['#below'];
if ($current_menu_link) {
$submenu = _unl_wdn_get_current_submenu($data['content'], $current_menu_link->mlid);
if (!theme_get_setting('disable_drill_down') && $submenu && $submenu['#original_link']['depth'] > 1) {
$data['content'] = $submenu['#below'];
}
}
$data['content'] = _unl_wdn_limit_menu_depth($data['content'], 2);
}
Expand Down Expand Up @@ -108,7 +107,7 @@ function unl_wdn_html_head_alter(&$head_elements) {
}

// If we are in a drilled down menu, change the home link to the drilled down item.
if (!theme_get_setting('drill_down')) {
if (!theme_get_setting('disable_drill_down')) {
$current_menu_link = _unl_wdn_get_current_menu_link();
if ($current_menu_link && $current_menu_link->depth > 1) {
$home_path = drupal_get_path_alias($current_menu_link->link_path);
Expand Down
4 changes: 2 additions & 2 deletions theme-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ function unl_wdn_form_system_theme_settings_alter(&$form, &$form_state) {
'#default_value' => theme_get_setting('sidebar_second_width'),
'#description' => t('Enter only the numeral, for grid4 just enter 4.'),
),
'drill_down' => array(
'disable_drill_down' => array(
'#type' => 'checkbox',
'#title' => t('Disable drill-down menus'),
'#default_value' => theme_get_setting('drill_down'),
'#default_value' => theme_get_setting('disable_drill_down'),
'#description' => t('Turns off changing the navigation if you are 2+ levels deep with even deeper enabled menu links.'),
),
'zen_forms' => array(
Expand Down

0 comments on commit cc259d5

Please sign in to comment.