diff --git a/modules/system/system.module b/modules/system/system.module index 92feed6be2d..9be91061b53 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -1981,6 +1981,16 @@ function system_block_view($delta = '') { } } +/** + * Implements hook_preprocess_block(). + */ +function system_preprocess_block(&$variables) { + // System menu blocks should get the same class as menu module blocks. + if ($variables['block']->module == 'system' && in_array($variables['block']->delta, array_keys(menu_list_system_menus()))) { + $variables['classes_array'][] = 'block-menu'; + } +} + /** * Provide a single block on the administration overview page. * diff --git a/themes/bartik/template.php b/themes/bartik/template.php index 128c6458da6..f57f9fa75c9 100644 --- a/themes/bartik/template.php +++ b/themes/bartik/template.php @@ -105,17 +105,9 @@ function bartik_process_maintenance_page(&$variables) { function bartik_preprocess_block(&$variables) { // In the header region, visually hide the title of any menu block or of the // user login block, but leave it accessible. - if ($variables['block']->region == 'header' && ($variables['block']->module == 'menu' || $variables['block']->module == 'user' && $variables['block']->delta == 'login')) { + if ($variables['block']->region == 'header' && ($variables['block']->module == 'user' && $variables['block']->delta == 'login' || in_array('block-menu', $variables['classes_array']))) { $variables['title_attributes_array']['class'][] = 'element-invisible'; } - // System menu blocks should get the same class as menu module blocks. - if (in_array($variables['block']->delta, array_keys(menu_list_system_menus()))) { - $variables['classes_array'][] = 'block-menu'; - // Also, hide the title if its in the header region. - if ($variables['block']->region == 'header') { - $variables['title_attributes_array']['class'][] = 'element-invisible'; - } - } // Set "first" and "last" classes. if ($variables['block']->position_first){ $variables['classes_array'][] = 'first';