Skip to content
Snippets Groups Projects
Commit ab193f75 authored by João Ventura's avatar João Ventura
Browse files

Use theme('item_list') to create the most* blocks.

parent 95f3e482
No related branches found
No related tags found
No related merge requests found
...@@ -190,11 +190,11 @@ function print_block_view($delta = '') { ...@@ -190,11 +190,11 @@ function print_block_view($delta = '') {
$result = db_query_range("SELECT path FROM {print_page_counter} LEFT JOIN {node} ON path = CONCAT('node/', node.nid) WHERE status <> 0 OR status IS NULL ORDER BY totalcount DESC", 0, 3) $result = db_query_range("SELECT path FROM {print_page_counter} LEFT JOIN {node} ON path = CONCAT('node/', node.nid) WHERE status <> 0 OR status IS NULL ORDER BY totalcount DESC", 0, 3)
->fetchAll(); ->fetchAll();
if (count($result)) { if (count($result)) {
$block['content'] = '<div class="item-list"><ul>'; $items = array();
foreach ($result as $obj) { foreach ($result as $obj) {
$block['content'] .= '<li>' . l(_print_get_title($obj->path), $obj->path) . '</li>'; $items[] = l(_print_get_title($obj->path), $obj->path);
} }
$block['content'] .= '</ul></div>'; $block['content'] = theme('item_list', array('items' => $items, 'type' => 'ul'));
} }
break; break;
} }
......
...@@ -133,11 +133,11 @@ function print_mail_block_view($delta = 0) { ...@@ -133,11 +133,11 @@ function print_mail_block_view($delta = 0) {
$result = db_query_range("SELECT path FROM {print_mail_page_counter} LEFT JOIN {node} ON path = CONCAT('node/', node.nid) WHERE status <> 0 OR status IS NULL ORDER BY sentcount DESC", 0, 3) $result = db_query_range("SELECT path FROM {print_mail_page_counter} LEFT JOIN {node} ON path = CONCAT('node/', node.nid) WHERE status <> 0 OR status IS NULL ORDER BY sentcount DESC", 0, 3)
->fetchAll(); ->fetchAll();
if (count($result)) { if (count($result)) {
$block['content'] = '<div class="item-list"><ul>'; $items = array();
foreach ($result as $obj) { foreach ($result as $obj) {
$block['content'] .= '<li>' . l(_print_get_title($obj->path), $obj->path) . '</li>'; $items[] = l(_print_get_title($obj->path), $obj->path);
} }
$block['content'] .= '</ul></div>'; $block['content'] = theme('item_list', array('items' => $items, 'type' => 'ul'));
} }
break; break;
} }
......
...@@ -104,11 +104,11 @@ function print_pdf_block_view($delta = 0) { ...@@ -104,11 +104,11 @@ function print_pdf_block_view($delta = 0) {
$result = db_query_range("SELECT path FROM {print_pdf_page_counter} LEFT JOIN {node} ON path = CONCAT('node/', node.nid) WHERE status <> 0 OR status IS NULL ORDER BY totalcount DESC", 0, 3) $result = db_query_range("SELECT path FROM {print_pdf_page_counter} LEFT JOIN {node} ON path = CONCAT('node/', node.nid) WHERE status <> 0 OR status IS NULL ORDER BY totalcount DESC", 0, 3)
->fetchAll(); ->fetchAll();
if (count($result)) { if (count($result)) {
$block['content'] = '<div class="item-list"><ul>'; $items = array();
foreach ($result as $obj) { foreach ($result as $obj) {
$block['content'] .= '<li>' . l(_print_get_title($obj->path), $obj->path) . '</li>'; $items[] = l(_print_get_title($obj->path), $obj->path);
} }
$block['content'] .= '</ul></div>'; $block['content'] = theme('item_list', array('items' => $items, 'type' => 'ul'));
} }
break; break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment