From 0b007f5413c990686e648aab3919e8fc94d67de1 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 14 May 2011 13:20:06 -0400 Subject: - Patch #1034248 by jhodgdon, drewish, jn2: hook_block_view() example should return a render array. --- modules/block/block.api.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'modules/block') diff --git a/modules/block/block.api.php b/modules/block/block.api.php index 90e23bde9..d33f59425 100644 --- a/modules/block/block.api.php +++ b/modules/block/block.api.php @@ -205,23 +205,27 @@ function hook_block_save($delta = '', $edit = array()) { * @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'. + // This example is adapted from node.module. $block = array(); switch ($delta) { case 'syndicate': $block['subject'] = t('Syndicate'); - $block['content'] = theme('feed_icon', array('url' => url('rss.xml'), 'title' => t('Syndicate'))); + $block['content'] = array( + '#theme' => 'feed_icon', + '#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, - )); + $block['content'] = array( + '#theme' => 'node_recent_block', + '#nodes' => $nodes, + ); } else { $block['content'] = t('No content available.'); } -- cgit v1.2.3