Index: modules/block/block.api.php =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.api.php,v retrieving revision 1.16 diff -u -r1.16 block.api.php --- modules/block/block.api.php 4 Feb 2011 20:09:15 -0000 1.16 +++ modules/block/block.api.php 9 Feb 2011 23:34:37 -0000 @@ -206,30 +206,15 @@ * @see hook_block_view_MODULE_DELTA_alter() */ function hook_block_view($delta = '') { - // This example comes from node.module. Note that you can also return a - // renderable array rather than rendered HTML for 'content'. - $block = array(); - - switch ($delta) { - case 'syndicate': - $block['subject'] = t('Syndicate'); - $block['content'] = theme('feed_icon', array('url' => url('rss.xml'), 'title' => t('Syndicate'))); - break; - - case 'recent': - if (user_access('access content')) { - $block['subject'] = t('Recent content'); - if ($nodes = node_get_recent(variable_get('node_recent_block_count', 10))) { - $block['content'] = theme('node_recent_block', array( - 'nodes' => $nodes, - )); - } else { - $block['content'] = t('No content available.'); - } - } - break; + // This example comes from menu.module. + $menus = menu_get_menus(FALSE); + $data['subject'] = check_plain($menus[$delta]); + $data['content'] = menu_tree($delta); + // Add contextual links for this block. + if (!empty($data['content'])) { + $data['content']['#contextual_links']['menu'] = array('admin/structure/menu/manage', array($delta)); } - return $block; + return $data; } /**