Commit ada6432e authored by Dries's avatar Dries

- Patch #809558 by mr.baileys: node_title_list() didn't return renderable array for block content.

parent 3d2110bf
......@@ -241,9 +241,14 @@ function blog_block_view($delta = '') {
->execute();
if ($node_title_list = node_title_list($result)) {
$block['content'] = $node_title_list;
$block['content'] .= theme('more_link', array('url' => url('blog'), 'title' => t('Read the latest blog entries.')));
$block['subject'] = t('Recent blog posts');
$block['content']['blog_list'] = $node_title_list;
$block['content']['blog_more'] = array(
'#theme' => 'more_link',
'#url' => url('blog'),
'#title' => t('Read the latest blog entries.'),
);
return $block;
}
}
......
......@@ -699,8 +699,8 @@ function forum_block_view($delta = '') {
function forum_block_view_pre_render($elements) {
$result = $elements['#query']->execute();
if ($node_title_list = node_title_list($result)) {
$elements['forum_list'] = array('#markup' => $node_title_list);
$elements['forum_more'] = array('#markup' => theme('more_link', array('url' => url('forum'), 'title' => t('Read the latest forum topics.'))));
$elements['forum_list'] = $node_title_list;
$elements['forum_more'] = array('#theme' => 'more_link', '#url' => url('forum'), '#title' => t('Read the latest forum topics.'));
}
return $elements;
}
......
......@@ -271,7 +271,7 @@ function node_admin_paths() {
}
/**
* Gather a listing of links to nodes.
* Gathers a listing of links to nodes.
*
* @param $result
* A DB result object from a query to fetch node entities. If your query
......@@ -282,8 +282,8 @@ function node_admin_paths() {
* A heading for the resulting list.
*
* @return
* An HTML list suitable as content for a block, or FALSE if no result can
* fetch from DB result object.
* A renderable array containing a list of linked node titles fetched from
* $result, or FALSE if there are no rows in $result.
*/
function node_title_list($result, $title = NULL) {
$items = array();
......@@ -293,7 +293,7 @@ function node_title_list($result, $title = NULL) {
$num_rows = TRUE;
}
return $num_rows ? theme('item_list__node', array('items' => $items, 'title' => $title)) : FALSE;
return $num_rows ? array('#theme' => 'item_list__node', '#items' => $items, '#title' => $title) : FALSE;
}
/**
......
......@@ -350,21 +350,24 @@ function statistics_block_view($delta = '') {
$daytop = variable_get('statistics_block_top_day_num', 0);
if ($daytop && ($result = statistics_title_list('daycount', $daytop)) && ($node_title_list = node_title_list($result, t("Today's:")))) {
$content[] = $node_title_list;
$content['top_day'] = $node_title_list;
$content['top_day']['#suffix'] = '<br />';
}
$alltimetop = variable_get('statistics_block_top_all_num', 0);
if ($alltimetop && ($result = statistics_title_list('totalcount', $alltimetop)) && ($node_title_list = node_title_list($result, t('All time:')))) {
$content[] = $node_title_list;
$content['top_all'] = $node_title_list;
$content['top_all']['#suffix'] = '<br />';
}
$lasttop = variable_get('statistics_block_top_last_num', 0);
if ($lasttop && ($result = statistics_title_list('timestamp', $lasttop)) && ($node_title_list = node_title_list($result, t('Last viewed:')))) {
$content[] = $node_title_list;
$content['top_last'] = $node_title_list;
$content['top_last']['#suffix'] = '<br />';
}
if (count($content)) {
$block['content'] = implode('<br />', $content);
$block['content'] = $content;
$block['subject'] = t('Popular content');
return $block;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment