function system_preprocess_block

Implements hook_preprocess_HOOK() for block.tpl.php.

File

drupal/core/modules/system/system.module, line 2547
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 'help':
        $variables['attributes']['role'] = 'complementary';
        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['attributes']['class'][] = 'block-menu';
        }
    }
  }
}