function system_block_view

Implements hook_block_view().

Generate a block with a promotional link to Drupal.org and all system menu blocks.

File

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

Code

function system_block_view($delta = '') {
  $block = array();
  switch ($delta) {
    case 'main':
      $block['subject'] = NULL;
      $block['content'] = drupal_set_page_content();
      return $block;
    case 'powered-by':
      $block['subject'] = NULL;
      $block['content'] = theme('system_powered_by');
      return $block;
    case 'help':
      $block['subject'] = NULL;
      $block['content'] = menu_get_active_help();
      return $block;
    default:

      // Strip off 'menu-' prefix from block delta.
      $delta = substr($delta, 5);

      // All system menu blocks.
      $system_menus = menu_list_system_menus();
      if (isset($system_menus[$delta])) {
        $block['subject'] = t($system_menus[$delta]);
        $block['content'] = menu_tree($delta);
        return $block;
      }
      break;
  }
}