Commit fe263c8f authored by catch's avatar catch

Issue #1221710 by aspilicious, jessebeach: Convert aggregator-summary-item.tpl.php to HTML5.

parent 3ed34f67
<?php
/**
* @file
* Default theme implementation to present a linked feed item for summaries.
*
* Available variables:
* - $feed_url: Link to originating feed.
* - $feed_title: Title of feed.
* - $feed_age: Age of remote feed.
* - $source_url: Link to remote source.
* - $source_title: Locally set title for the source.
*
* @see template_preprocess()
* @see template_preprocess_aggregator_summary_item()
*
* @ingroup themeable
*/
?>
<a href="<?php print $feed_url; ?>"><?php print $feed_title; ?></a>
<span class="age"><?php print $feed_age; ?></span>
<?php if ($source_url): ?>,
<span class="source"><a href="<?php print $source_url; ?>"><?php print $source_title; ?></a></span>
<?php endif; ?>
......@@ -74,7 +74,6 @@ function aggregator_theme() {
'aggregator_summary_item' => array(
'variables' => array('item' => NULL),
'file' => 'aggregator.pages.inc',
'template' => 'aggregator-summary-item',
),
'aggregator_item' => array(
'variables' => array('item' => NULL),
......
......@@ -289,6 +289,21 @@ function theme_aggregator_categorize_items($variables) {
return theme('aggregator_wrapper', array('content' => $output));
}
/**
* Default theme implementation to present a linked feed item for summaries.
*
* @param $variables
* An associative array containing:
* - item_link: Link to item.
* - item_age: Age of the item.
*
* @see template_preprocess()
* @see template_preprocess_aggregator_summary_item()
*/
function theme_aggregator_summary_item($variables) {
return $variables['item_url'] . ' ' . $variables['item_age'];
}
/**
* Processes variables for aggregator-wrapper.tpl.php.
*
......@@ -521,16 +536,19 @@ function template_preprocess_aggregator_summary_items(&$variables) {
function template_preprocess_aggregator_summary_item(&$variables) {
$item = $variables['item'];
$variables['feed_url'] = check_url($item->link);
$variables['feed_title'] = check_plain($item->title);
$variables['feed_age'] = t('%age old', array('%age' => format_interval(REQUEST_TIME - $item->timestamp)));
$variables['source_url'] = '';
$variables['source_title'] = '';
if (!empty($item->feed_link)) {
$variables['source_url'] = check_url($item->feed_link);
$variables['source_title'] = check_plain($item->feed_title);
}
$variables['item_url'] = l(check_plain($item->title), check_url(url($item->link, array('absolute' => TRUE))), array(
'attributes' => array(
'class' => array('feed-item-url',),
),
));
$variables['item_age'] = theme('datetime', array(
'attributes' => array(
'datetime' => format_date($item->timestamp, 'html_datetime', '', 'UTC'),
'class' => array('feed-item-age',),
),
'text' => t('%age old', array('%age' => format_interval(REQUEST_TIME - $item->timestamp))),
'html' => TRUE,
));
}
/**
......
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