1 system.module system_block_view($delta = '', $settings = array())

Implements hook_block_view().

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

File

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

Code

function system_block_view($delta = '', $settings = array()) {
  $block = array();
  switch ($delta) {
    case 'main':
      $router_item = menu_get_item();
      if ($router_item['include_file']) {
        require_once BACKDROP_ROOT . '/' . $router_item['include_file'];
      }
      $block['subject'] = NULL;
      $block['content'] = call_user_func_array($router_item['page_callback'], $router_item['page_arguments']);
      return $block;
    case 'header':
      $block['subject'] = NULL;
      $block['content'] = system_header_block($settings);
      return $block;
    case 'breadcrumb':
      $block['subject'] = NULL;
      $block['content'] = system_breadcrumb_block($settings);
      return $block;
    case 'powered-by':
      $block['subject'] = NULL;
      $block['content'] = theme('system_powered_by');
      return $block;
    default:
      // All system menu blocks.
      $system_menus = menu_list_system_menus();
      if (isset($system_menus[$delta])) {
        module_load_include('inc', 'system', 'system.menu');
        $settings += system_menu_block_defaults($delta);
        $data = system_menu_block_build($settings);
        $block['subject'] = $data['subject'];
        $block['content'] = $data['content'];
        return $block;
      }
      break;
  }
}