You are here

function dashboard_block_info_alter in Drupal 7

Implements hook_block_info_alter().

File

modules/dashboard/dashboard.module, line 101
Provides a dashboard page in the administrative interface.

Code

function dashboard_block_info_alter(&$blocks, $theme, $code_blocks) {
  $admin_theme = variable_get('admin_theme');
  if ($admin_theme && $theme == $admin_theme || !$admin_theme && $theme == variable_get('theme_default', 'bartik')) {
    foreach ($blocks as $module => &$module_blocks) {
      foreach ($module_blocks as $delta => &$block) {

        // Make administrative blocks that are not already in use elsewhere
        // available for the dashboard.
        if (empty($block['status']) && (empty($block['region']) || $block['region'] == BLOCK_REGION_NONE) && !empty($code_blocks[$module][$delta]['properties']['administrative'])) {
          $block['status'] = 1;
          $block['region'] = 'dashboard_inactive';
        }
      }
    }
  }
}