diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 1e1686a..d1eb204 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -761,3 +761,12 @@ function aggregator_sanitize_configuration() { function _aggregator_items($count) { return format_plural($count, '1 item', '@count items'); } + +/** + * Implements hook_preprocess_block(). + */ +function aggregator_preprocess_block(&$variables) { + if ($variables['block']->module == 'aggregator') { + $variables['attributes_array']['role'] = 'complementary'; + } +} diff --git a/modules/blog/blog.module b/modules/blog/blog.module index 731bd2f..b986d58 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -270,3 +270,12 @@ function blog_rdf_mapping() { ), ); } + +/** + * Implements hook_preprocess_block(). + */ +function blog_preprocess_block(&$variables) { + if ($variables['block']->module == 'blog') { + $variables['attributes_array']['role'] = 'navigation'; + } +} diff --git a/modules/book/book.module b/modules/book/book.module index de9561f..6478693 100644 --- a/modules/book/book.module +++ b/modules/book/book.module @@ -959,6 +959,15 @@ function _book_link_defaults($nid) { } /** + * Implements hook_preprocess_block(). + */ +function book_preprocess_block(&$variables) { + if ($variables['block']-> module == 'book') { + $variables['attributes_array']['role'] = 'navigation'; + } +} + +/** * Process variables for book-all-books-block.tpl.php. * * The $variables array contains the following arguments: diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 60a9ca4..98cecef 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -2235,6 +2235,15 @@ function comment_form_submit($form, &$form_state) { } /** + * Implements hook_preprocess_block(). + */ +function comment_preprocess_block(&$variables) { + if ($variables['block']->module == 'comment') { + $variables['attributes_array']['role'] = 'navigation'; + } +} + +/** * Process variables for comment.tpl.php. * * @see comment.tpl.php diff --git a/modules/forum/forum.module b/modules/forum/forum.module index c58b5c9..a360dab 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -959,6 +959,15 @@ function forum_get_topics($tid, $sortby, $forum_per_page) { } /** + * Implements hook_preprocess_block(). + */ +function forum_preprocess_block(&$variables) { + if ($variables['block']->module == 'forum') { + $variables['attributes_array']['role'] = 'navigation'; + } +} + +/** * Process variables for forums.tpl.php * * The $variables array contains the following arguments: diff --git a/modules/help/help.module b/modules/help/help.module index 773a52d..2bb81a6 100644 --- a/modules/help/help.module +++ b/modules/help/help.module @@ -61,3 +61,12 @@ function help_help($path, $arg) { return $output; } } + +/** + * Implements hook_preprocess_block(). + */ +function help_preprocess_block(&$variables) { + if ($variables['block']->module == 'help') { + $variables['attributes_array']['role'] = 'complementary'; + } +} diff --git a/modules/locale/locale.module b/modules/locale/locale.module index 0788461..fdd86a9 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -1036,3 +1036,12 @@ function locale_form_comment_form_alter(&$form, &$form_state, $form_id) { $form['language']['#value'] = $language_content->language; } } + +/** + * Implements hook_preprocess_block(). + */ +function locale_preprocess_block(&$variables) { + if ($variables['block']->module == 'locale') { + $variables['attributes_array']['role'] = 'complementary'; + } +} diff --git a/modules/menu/menu.module b/modules/menu/menu.module index fc8f68a..8d36e49 100644 --- a/modules/menu/menu.module +++ b/modules/menu/menu.module @@ -760,3 +760,12 @@ function menu_get_menus($all = TRUE) { } return $custom_menus; } + +/** + * Implements hook_preprocess_block(). + */ +function menu_preprocess_block(&$variables) { + if ($variables['block']->module == 'menu') { + $variables['attributes_array']['role'] = 'navigation'; + } +} diff --git a/modules/node/node.module b/modules/node/node.module index 2dd1926..9b4bc00 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1423,6 +1423,23 @@ function node_is_page($node) { } /** + * Implements hook_preprocess_block(). + */ +function node_preprocess_block(&$variables) { + if ($variables['block']->module == 'node') { + switch ($variables['block']->delta) { + case 'syndicate': + $variables['attributes_array']['role'] = 'complementary'; + break; + + case 'recent': + $variables['attributes_array']['role'] = 'navigation'; + break; + } + } +} + +/** * Process variables for node.tpl.php * * Most themes utilize their own copy of node.tpl.php. The default is located diff --git a/modules/poll/poll.module b/modules/poll/poll.module index f45b8bd..95f4aa0 100644 --- a/modules/poll/poll.module +++ b/modules/poll/poll.module @@ -776,6 +776,15 @@ function poll_vote($form, &$form_state) { } /** + * Implements hook_preprocess_block(). + */ +function poll_preprocess_block(&$variables) { + if ($variables['block']->module == 'poll') { + $variables['attributes_array']['role'] = 'complementary'; + } +} + +/** * Themes the voting form for a poll. * * Inputs: $form diff --git a/modules/profile/profile.module b/modules/profile/profile.module index 2374fe8..d8cd5ef 100644 --- a/modules/profile/profile.module +++ b/modules/profile/profile.module @@ -529,6 +529,15 @@ function profile_category_access($account, $category) { } /** + * Implements hook_preprocess_block(). + */ +function profile_preprocess_block(&$variables) { + if ($variables['block']->module == 'profile') { + $variables['attributes_array']['role'] = 'complementary'; + } +} + +/** * Process variables for profile-block.tpl.php. * * The $variables array contains the following arguments: diff --git a/modules/search/search.module b/modules/search/search.module index 518272a..a0dabb4 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -1349,3 +1349,11 @@ function search_forms() { return $forms; } +/** + * Implements hook_preprocess_block(). + */ +function search_preprocess_block(&$variables) { + if ($variables['block']->module == 'search') { + $variables['attributes_array']['role'] = 'search'; + } +} diff --git a/modules/shortcut/shortcut.module b/modules/shortcut/shortcut.module index d2ac72b..b2ef56e 100644 --- a/modules/shortcut/shortcut.module +++ b/modules/shortcut/shortcut.module @@ -640,6 +640,15 @@ function shortcut_renderable_links($shortcut_set = NULL) { } /** + * Implements hook_preprocess_block(). + */ +function shortcut_preprocess_block(&$variables) { + if ($variables['block']->module == 'shortcut') { + $variables['attributes_array']['role'] = 'navigation'; + } +} + +/** * Implements hook_preprocess_page(). */ function shortcut_preprocess_page(&$variables) { diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module index 6b7be8a..4b6f7be 100644 --- a/modules/statistics/statistics.module +++ b/modules/statistics/statistics.module @@ -425,3 +425,11 @@ function statistics_ranking() { function statistics_update_index() { variable_set('node_cron_views_scale', 1.0 / max(1, db_query('SELECT MAX(totalcount) FROM {node_counter}')->fetchField())); } +/** + * Implements hook_preprocess_block(). + */ +function statistics_preprocess_block(&$variables) { + if ($variables['block']->module == 'statistics') { + $variables['attributes_array']['role'] = 'navigation'; + } +} diff --git a/modules/system/system.module b/modules/system/system.module index 3ebc657..743a695 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -2066,9 +2066,28 @@ 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'; + if ($variables['block']->module == 'system') { + + switch ($variables['block']->delta) { + case 'main': + $variables['attributes_array']['role'] = 'main'; + break; + + case 'powered-by': + $variables['attributes_array']['role'] = 'complementary'; + break; + + case 'help': + $variables['attributes_array']['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_array']['role'] = 'navigation'; + $variables['classes_array'][] = 'block-menu'; + } + } } } diff --git a/modules/user/user.module b/modules/user/user.module index ffd170c..adb2b59 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -1411,6 +1411,27 @@ function user_block_view($delta = '') { } /** + * Implements hook_preprocess_block(). + */ +function user_preprocess_block(&$variables) { + if ($variables['block']->module == 'user') { + switch ($variables['block']->delta) { + case 'login': + $variables['attributes_array']['role'] = 'form'; + break; + + case 'new': + $variables['attributes_array']['role'] = 'complementary'; + break; + + case 'online': + $variables['attributes_array']['role'] = 'complementary'; + break; + } + } +} + +/** * Process variables for user-picture.tpl.php. * * The $variables array contains the following arguments: