Commit 41542ef0 authored by Dries's avatar Dries

- Patch #101268 by webernet et al: improve the usability of feed icons.

parent 24038816
......@@ -163,7 +163,7 @@ function drupal_add_feed($url = NULL, $title = '') {
static $stored_feed_links = array();
if (!is_null($url)) {
$stored_feed_links[$url] = theme('feed_icon', $url);
$stored_feed_links[$url] = theme('feed_icon', $url, $title);
drupal_add_link(array('rel' => 'alternate',
'type' => 'application/rss+xml',
......@@ -2417,7 +2417,7 @@ function drupal_common_themes() {
'arguments' => array('url' => NULL),
),
'feed_icon' => array(
'arguments' => array('url' => NULL),
'arguments' => array('url' => NULL, 'title' => NULL),
),
'closure' => array(
'arguments' => array('main' => 0),
......
......@@ -1300,9 +1300,14 @@ function theme_xml_icon($url) {
/**
* Return code that emits an feed icon.
*/
function theme_feed_icon($url) {
if ($image = theme('image', 'misc/feed.png', t('Syndicate content'), t('Syndicate content'))) {
*
* @param $url
* The url of the feed.
* @param $title
* A descriptive title of the feed.
*/
function theme_feed_icon($url, $title) {
if ($image = theme('image', 'misc/feed.png', t('Syndicate content'), $title)) {
return '<a href="'. check_url($url) .'" class="feed-icon">'. $image .'</a>';
}
}
......
......@@ -1325,7 +1325,7 @@ function aggregator_page_categories() {
*/
function theme_aggregator_feed($feed) {
$output = '<div class="feed-source">';
$output .= theme('feed_icon', $feed->url) ."\n";
$output .= theme('feed_icon', $feed->url, t('!title feed', array('!title' => $feed->title))) ."\n";
$output .= $feed->image;
$output .= '<div class="feed-description">'. aggregator_filter_xss($feed->description) ."</div>\n";
$output .= '<div class="feed-url"><em>'. t('URL:') .'</em> '. l($feed->link, $feed->link, array('absolute' => TRUE)) ."</div>\n";
......
......@@ -1836,7 +1836,7 @@ function node_block($op = 'list', $delta = 0) {
}
else if ($op == 'view') {
$block['subject'] = t('Syndicate');
$block['content'] = theme('feed_icon', url('rss.xml'));
$block['content'] = theme('feed_icon', url('rss.xml'), t('Syndicate'));
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