You are here

function system_block_info in Drupal 7

Implements hook_block_info().

File

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

Code

function system_block_info() {
  $blocks['main'] = array(
    'info' => t('Main page content'),
    // Cached elsewhere.
    'cache' => DRUPAL_NO_CACHE,
    // Auto-enable in 'content' region by default, which always exists.
    // @see system_themes_page(), drupal_render_page()
    'status' => 1,
    'region' => 'content',
  );
  $blocks['powered-by'] = array(
    'info' => t('Powered by Drupal'),
    'weight' => '10',
    'cache' => DRUPAL_NO_CACHE,
  );
  $blocks['help'] = array(
    'info' => t('System help'),
    'weight' => '5',
    'cache' => DRUPAL_NO_CACHE,
    // Auto-enable in 'help' region by default, if the theme defines one.
    'status' => 1,
    'region' => 'help',
  );

  // System-defined menu blocks.
  foreach (menu_list_system_menus() as $menu_name => $title) {
    $blocks[$menu_name]['info'] = t($title);

    // Menu blocks can't be cached because each menu item can have
    // a custom access callback. menu.inc manages its own caching.
    $blocks[$menu_name]['cache'] = DRUPAL_NO_CACHE;
  }
  return $blocks;
}