summaryrefslogtreecommitdiff
path: root/modules/aggregator/aggregator.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-10-09 01:00:08 +0000
committerDries Buytaert <dries@buytaert.net>2009-10-09 01:00:08 +0000
commitc05f2181dc8556cb6700e8c6bb6e6ded43273192 (patch)
tree5446facb7f5f18dfaac48aade56c0d86f1477fff /modules/aggregator/aggregator.module
parent48dd14a898420ae98984c951f59e8d299080bee8 (diff)
downloadbrdo-c05f2181dc8556cb6700e8c6bb6e6ded43273192.tar.gz
brdo-c05f2181dc8556cb6700e8c6bb6e6ded43273192.tar.bz2
- Patch #572618 by effulgentsia, pwolanin, sun: all theme functions should take a single argument. Code clean-up and performance improvement. Woot.
Diffstat (limited to 'modules/aggregator/aggregator.module')
-rw-r--r--modules/aggregator/aggregator.module23
1 files changed, 11 insertions, 12 deletions
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index 765f877e6..d8428f98d 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -390,7 +390,7 @@ function aggregator_block_view($delta = '') {
if ($feed = db_query('SELECT fid, title, block FROM {aggregator_feed} WHERE block <> 0 AND fid = :fid', array(':fid' => $id))->fetchObject()) {
$block['subject'] = check_plain($feed->title);
$result = db_query_range("SELECT * FROM {aggregator_item} WHERE fid = :fid ORDER BY timestamp DESC, iid DESC", 0, $feed->block, array(':fid' => $id));
- $read_more = theme('more_link', url('aggregator/sources/' . $feed->fid), t("View this feed's recent news."));
+ $read_more = theme('more_link', array('url' => url('aggregator/sources/' . $feed->fid), 'title' => t("View this feed's recent news.")));
}
break;
@@ -398,18 +398,18 @@ function aggregator_block_view($delta = '') {
if ($category = db_query('SELECT cid, title, block FROM {aggregator_category} WHERE cid = :cid', array(':cid' => $id))->fetchObject()) {
$block['subject'] = check_plain($category->title);
$result = db_query_range('SELECT i.* FROM {aggregator_category_item} ci LEFT JOIN {aggregator_item} i ON ci.iid = i.iid WHERE ci.cid = :cid ORDER BY i.timestamp DESC, i.iid DESC', 0, $category->block, array(':cid' => $category->cid));
- $read_more = theme('more_link', url('aggregator/categories/' . $category->cid), t("View this category's recent news."));
+ $read_more = theme('more_link', array('url' => url('aggregator/categories/' . $category->cid), 'title' => t("View this category's recent news.")));
}
break;
}
$items = array();
foreach ($result as $item) {
- $items[] = theme('aggregator_block_item', $item);
+ $items[] = theme('aggregator_block_item', array('item' => $item));
}
// Only display the block if there are items to show.
if (count($items) > 0) {
- $block['content'] = theme('item_list', $items) . $read_more;
+ $block['content'] = theme('item_list', array('items' => $items)) . $read_more;
}
return $block;
}
@@ -642,19 +642,18 @@ function aggregator_category_load($cid) {
/**
* Format an individual feed item for display in the block.
*
- * @param $item
- * The item to be displayed.
- * @param $feed
- * Not used.
+ * @param $variables
+ * An associative array containing:
+ * - item: The item to be displayed.
+ * - feed: Not used.
+ *
* @return
* The item HTML.
* @ingroup themeable
*/
-function theme_aggregator_block_item($item, $feed = 0) {
-
+function theme_aggregator_block_item($variables) {
// Display the external link to the item.
- return '<a href="' . check_url($item->link) . '">' . check_plain($item->title) . "</a>\n";
-
+ return '<a href="' . check_url($variables['item']->link) . '">' . check_plain($variables['item']->title) . "</a>\n";
}
/**