summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAlex Pott2013-06-24 08:12:50 (GMT)
committerAlex Pott2013-06-24 08:12:50 (GMT)
commit58c54c35fd41de3286af8a4c455bdefaf65b1f6e (patch)
treeb43fc5ba7b5a1fb698a5e72ff85ccc2108f44c10 /core
parentd91dc9136724d049bf0e9f71eb8865fc2cf5a28a (diff)
Issue #2008970 by markie, adamcowboy: Replace theme() with drupal_render() in aggregator module.
Diffstat (limited to 'core')
-rw-r--r--core/modules/aggregator/aggregator.pages.inc39
-rw-r--r--core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorCategoryBlock.php19
-rw-r--r--core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorFeedBlock.php20
3 files changed, 62 insertions, 16 deletions
diff --git a/core/modules/aggregator/aggregator.pages.inc b/core/modules/aggregator/aggregator.pages.inc
index 8938e95..b6d4062 100644
--- a/core/modules/aggregator/aggregator.pages.inc
+++ b/core/modules/aggregator/aggregator.pages.inc
@@ -376,7 +376,12 @@ function aggregator_page_rss() {
}
$feeds = $result->fetchAll();
- return theme('aggregator_page_rss', array('feeds' => $feeds, 'category' => $category));
+ $aggregator_page_rss = array(
+ '#theme' => 'aggregator_page_rss',
+ '#feeds' => $feeds,
+ '#category' => $category,
+ );
+ return drupal_render($aggregator_page_rss);
}
/**
@@ -448,7 +453,11 @@ function aggregator_page_opml($cid = NULL) {
}
$feeds = $result->fetchAll();
- return theme('aggregator_page_opml', array('feeds' => $feeds));
+ $aggregator_page_opml = array(
+ '#theme' => 'aggregator_page_opml',
+ '#feeds' => $feeds,
+ );
+ return drupal_render($aggregator_page_opml);
}
/**
@@ -523,14 +532,16 @@ function template_preprocess_aggregator_summary_item(&$variables) {
'class' => array('feed-item-url',),
),
));
- $variables['item_age'] = theme('datetime', array(
- 'attributes' => array(
+ $datetime = array(
+ '#theme' => 'datetime',
+ '#attributes' => array(
'datetime' => format_date($item->timestamp->value, 'html_datetime', '', 'UTC'),
'class' => array('feed-item-age',),
),
- 'text' => t('%age old', array('%age' => format_interval(REQUEST_TIME - $item->timestamp->value))),
- 'html' => TRUE,
- ));
+ '#text' => t('%age old', array('%age' => format_interval(REQUEST_TIME - $item->timestamp->value))),
+ '#html' => TRUE,
+ );
+ $variables['item_age'] = drupal_render($datetime);
}
/**
@@ -546,10 +557,20 @@ function template_preprocess_aggregator_summary_item(&$variables) {
function template_preprocess_aggregator_feed_source(&$variables) {
$feed = $variables['aggregator_feed'];
- $variables['source_icon'] = theme('feed_icon', array('url' => $feed->url->value, 'title' => t('!title feed', array('!title' => $feed->label()))));
+ $feed_icon = array(
+ '#theme' => 'feed_icon',
+ '#url' => $feed->url->value,
+ '#title' => t('!title feed', array('!title' => $feed->label())),
+ );
+ $variables['source_icon'] = drupal_render($feed_icon);
if (!empty($feed->image->value) && $feed->label() && !empty($feed->link->value)) {
- $variables['source_image'] = l(theme('image', array('path' => $feed->image->value, 'alt' => $feed->title->value)), $feed->link->value, array('html' => TRUE, 'attributes' => array('class' => 'feed-image')));
+ $image = array(
+ '#theme' => 'image',
+ '#path' => $feed->image->value,
+ '#alt' => $feed->title->value,
+ );
+ $variables['source_image'] = l($image, $feed->link->value, array('html' => TRUE, 'attributes' => array('class' => 'feed-image')));
}
else {
$variables['source_image'] = '';
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorCategoryBlock.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorCategoryBlock.php
index 423c903..c9fe040 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorCategoryBlock.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorCategoryBlock.php
@@ -68,17 +68,30 @@ class AggregatorCategoryBlock extends BlockBase {
$id = $this->getPluginId();
if ($category = db_query('SELECT cid, title, block FROM {aggregator_category} WHERE cid = :cid', array(':cid' => $id))->fetchObject()) {
$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, $this->configuration['block_count'], array(':cid' => $category->cid));
- $read_more = theme('more_link', array('url' => 'aggregator/categories/' . $category->cid, 'title' => t("View this category's recent news.")));
+ $more_link = array(
+ '#theme' => 'more_link',
+ '#url' => 'aggregator/categories/' . $category->cid,
+ '#title' => t("View this category's recent news."),
+ );
+ $read_more = drupal_render($more_link);
$items = array();
foreach ($result as $item) {
- $items[] = theme('aggregator_block_item', array('item' => $item));
+ $aggregator_block_item = array(
+ '#theme' => 'aggregator_block_item',
+ '#item' => $item,
+ );
+ $items[] = drupal_render($aggregator_block_item);
}
// Only display the block if there are items to show.
if (count($items) > 0) {
+ $item_list = array(
+ '#theme' => 'item_list',
+ '#items' => $items,
+ );
return array(
- '#children' => theme('item_list', array('items' => $items)) . $read_more,
+ '#children' => drupal_render($item_list) . $read_more,
);
}
return array();
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorFeedBlock.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorFeedBlock.php
index 3cd519f..4b002a2 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorFeedBlock.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Block/AggregatorFeedBlock.php
@@ -69,16 +69,28 @@ class AggregatorFeedBlock extends BlockBase {
list(, $id) = explode(':', $this->getPluginId());
if ($feed = db_query('SELECT fid, title, block FROM {aggregator_feed} WHERE block <> 0 AND fid = :fid', array(':fid' => $id))->fetchObject()) {
$result = db_query_range("SELECT * FROM {aggregator_item} WHERE fid = :fid ORDER BY timestamp DESC, iid DESC", 0, $this->configuration['block_count'], array(':fid' => $id));
- $read_more = theme('more_link', array('url' => 'aggregator/sources/' . $feed->fid, 'title' => t("View this feed's recent news.")));
-
+ $more_link = array(
+ '#theme' => 'more_link',
+ '#url' => 'aggregator/sources/' . $feed->fid,
+ '#title' => t("View this feed's recent news."),
+ );
+ $read_more = drupal_render($more_link);
$items = array();
foreach ($result as $item) {
- $items[] = theme('aggregator_block_item', array('item' => $item));
+ $aggregator_block_item = array(
+ '#theme' => 'aggregator_block_item',
+ '#item' => $item,
+ );
+ $items[] = drupal_render($aggregator_block_item);
}
// Only display the block if there are items to show.
if (count($items) > 0) {
+ $item_list = array(
+ '#theme' => 'item_list',
+ '#items' => $items,
+ );
return array(
- '#children' => theme('item_list', array('items' => $items)) . $read_more,
+ '#children' => drupal_render($item_list) . $read_more,
);
}
}