summaryrefslogtreecommitdiff
path: root/modules/block
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2011-05-14 13:20:06 -0400
committerDries Buytaert <dries@buytaert.net>2011-05-14 13:20:06 -0400
commit0b007f5413c990686e648aab3919e8fc94d67de1 (patch)
tree59c5d631ce195674a5c7f738f360139075591d99 /modules/block
parentff23dc7162e6844294af052c1831fcd942fc0de7 (diff)
downloadbrdo-0b007f5413c990686e648aab3919e8fc94d67de1.tar.gz
brdo-0b007f5413c990686e648aab3919e8fc94d67de1.tar.bz2
- Patch #1034248 by jhodgdon, drewish, jn2: hook_block_view() example should return a render array.
Diffstat (limited to 'modules/block')
-rw-r--r--modules/block/block.api.php16
1 files changed, 10 insertions, 6 deletions
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.');
}