#845928 by JohnAlbin: Fixed System menu blocks don't get the same styling as menu module blocks.
parent
8db34bb271
commit
a4df7936bb
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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';
|
||||
|
|
Loading…
Reference in New Issue