1.20.x system.module system_preprocess_block(&$variables)

Implements hook_preprocess_block().

File

modules/system/system.module, line 2632
Configuration system that lets administrators modify the workings of the site.

Code

function system_preprocess_block(&$variables) {
  if ($variables['block']->module == 'system') {

    switch ($variables['block']->delta) {
      case 'powered-by':
        $variables['attributes']['role'] = 'complementary';
        break;

      case 'main':
        $variables['classes'] = array_values(array_diff($variables['classes'], array('block', 'block-system-main')));
        break;

        // System menu blocks should get the same class as menu module blocks.
      default:
        if (in_array($variables['block']->delta, array_keys(menu_list_system_menus()))) {
          $variables['attributes']['role'] = 'navigation';
          $variables['classes'][] = 'block-menu';
        }
    }
  }
}