From cad0bdd1c3c2aef6dabd7b570697b1dee84a9980 Mon Sep 17 00:00:00 2001 From: William Hearn Date: Thu, 22 Sep 2016 12:27:01 -0400 Subject: [PATCH] Issue #2799287: Update to gcweb footer --- templates/menu/menu-link.func.php | 39 ++++++++++++---------------- templates/page/page--gcweb.tpl.php | 34 ++++++++---------------- templates/panels/page--panels--gcweb.tpl.php | 34 ++++++++---------------- templates/system/page.vars.php | 7 ++++- 4 files changed, 45 insertions(+), 69 deletions(-) diff --git a/templates/menu/menu-link.func.php b/templates/menu/menu-link.func.php index b9ff06b..e41d500 100644 --- a/templates/menu/menu-link.func.php +++ b/templates/menu/menu-link.func.php @@ -120,12 +120,6 @@ function wetkit_bootstrap_menu_link__menu_block__mid_footer_menu(&$variables) { $wxt_active = str_replace('-', '_', $wxt_active); $wxt_active = str_replace('theme_', '', $wxt_active); - if ($element['#below']) { - if ((!empty($element['#original_link']['depth'])) && ($element['#original_link']['depth'] == 1)) { - $sub_menu = ''; - } - } - // On primary navigation menu, class 'active' is not set on active menu item. // @see https://drupal.org/node/1896674. if (($element['#href'] == $_GET['q'] || ($element['#href'] == '' && drupal_is_front_page())) && (empty($element['#localized_options']['language']))) { @@ -141,31 +135,32 @@ function wetkit_bootstrap_menu_link__menu_block__mid_footer_menu(&$variables) { ); } - if ($element['#original_link']['depth'] == 1) { - if ($wxt_active == 'gcweb') { - $counter = $counter + 1; - $output = '

' . l($element['#title'], $element['#href'], $element['#localized_options']) . '

'; - if ($counter == 3) { - return '
' . $output . $sub_menu . '
'; - } - elseif ($counter >= 4) { - return '
' . $output . $sub_menu . '
'; - } - elseif ($counter % 2 != 0) { - return '
' . $output . $sub_menu . '
'; - } - elseif ($counter % 2 == 0) { - return '
' . $output . $sub_menu . '
'; + if ($wxt_active != 'gcweb') { + if ($element['#below']) { + if ((!empty($element['#original_link']['depth'])) && ($element['#original_link']['depth'] == 1)) { + $sub_menu = ''; } } - else { + if ($element['#original_link']['depth'] == 1) { $output = '

' . l($element['#title'], $element['#href'], $element['#localized_options']) . '

'; return '
' . $output . $sub_menu . '
'; } + else { + $output = l($element['#title'], $element['#href'], $element['#localized_options']); + return '' . $output . $sub_menu . "\n"; + } } else { + if ($element['#below']) { + if ((!empty($element['#original_link']['depth'])) && ($element['#original_link']['depth'] == 1)) { + // Add our own wrapper. + unset($element['#below']['#theme_wrappers']); + $sub_menu = drupal_render($element['#below']); + } + } $output = l($element['#title'], $element['#href'], $element['#localized_options']); return '' . $output . $sub_menu . "\n"; + } } diff --git a/templates/page/page--gcweb.tpl.php b/templates/page/page--gcweb.tpl.php index 9bd8b86..22f6244 100644 --- a/templates/page/page--gcweb.tpl.php +++ b/templates/page/page--gcweb.tpl.php @@ -201,35 +201,23 @@