From 1a91990cae84f045b774e0eb308334dea1e97b28 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sat, 20 Nov 2010 04:03:51 +0000 Subject: #599706 follow-up by JohnAlbin, sun: Regression: Restore consistency to theme_menu_local_tasks() theme function --- includes/menu.inc | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) (limited to 'includes/menu.inc') diff --git a/includes/menu.inc b/includes/menu.inc index 9d3fef979..b72e3ff90 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -2132,22 +2132,35 @@ function menu_tab_root_path() { } /** - * Returns renderable local tasks. + * Returns a renderable element for the primary and secondary tabs. + */ +function menu_local_tabs() { + return array( + '#theme' => 'menu_local_tasks', + '#primary' => menu_primary_local_tasks(), + '#secondary' => menu_secondary_local_tasks(), + ); +} + +/** + * Returns HTML for primary and secondary local tasks. * * @ingroup themeable */ -function theme_menu_local_tasks() { - $output = array(); +function theme_menu_local_tasks(&$variables) { + $output = ''; - if ($primary = menu_primary_local_tasks()) { - $primary['#prefix'] = '

' . t('Primary tabs') . '

'; - $output[] = $primary; - } - if ($secondary = menu_secondary_local_tasks()) { - $secondary['#prefix'] = '

' . t('Secondary tabs') . '

'; - $output[] = $secondary; + if (!empty($variables['primary'])) { + $variables['primary']['#prefix'] = '

' . t('Primary tabs') . '

'; + $variables['primary']['#prefix'] .= ''; + $output .= drupal_render($variables['primary']); + } + if (!empty($variables['secondary'])) { + $variables['secondary']['#prefix'] = '

' . t('Secondary tabs') . '

'; + $variables['secondary']['#prefix'] .= ''; + $output .= drupal_render($variables['secondary']); } return $output; -- cgit v1.2.3