diff --git a/includes/common.inc b/includes/common.inc index c9de3a4344ac6f86fe07a09fe03dcd033e983c77..e2d51f23d9bfeb31e0df22bdd22fa324d54bc20c 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -153,14 +153,19 @@ function drupal_get_headers() { * * @param $url * The url for the feed - * @param $theme_function - * The name of the theming function to use to style the feed icon, defaults to theme_feed_icon() + * @param $title + * The title of the feed */ -function drupal_add_feed($url = NULL, $theme_function = 'feed_icon') { +function drupal_add_feed($url = NULL, $title = '') { static $stored_feed_links = array(); if (!is_null($url)) { - $stored_feed_links[$url] = theme($theme_function, $url); + $stored_feed_links[$url] = theme('feed_icon', $url); + + drupal_add_link(array('rel' => 'alternate', + 'type' => 'application/rss+xml', + 'title' => $title, + 'href' => $url)); } return $stored_feed_links; } diff --git a/modules/blog/blog.module b/modules/blog/blog.module index b0227e66d8ccbd55dc84166c842ef9355c9efed0..7b93d2129f774f8cd24b7d86fe93cea4594d713e 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -163,12 +163,8 @@ function blog_page_user($uid) { $output .= node_view(node_load($node->nid), 1); } $output .= theme('pager', NULL, variable_get('default_nodes_main', 10)); - drupal_add_feed(url('blog/'. $account->uid .'/feed')); + drupal_add_feed(url('blog/'. $account->uid .'/feed'), t('RSS - !title', array('!title' => $title)); - drupal_add_link(array('rel' => 'alternate', - 'type' => 'application/rss+xml', - 'title' => t('RSS - !title', array('!title' => $title)), - 'href' => url("blog/$account->uid/feed"))); return $output; } else { @@ -190,12 +186,8 @@ function blog_page_last() { $output .= node_view(node_load($node->nid), 1); } $output .= theme('pager', NULL, variable_get('default_nodes_main', 10)); - drupal_add_feed(url('blog/feed')); + drupal_add_feed(url('blog/feed'), t('RSS - blogs')); - drupal_add_link(array('rel' => 'alternate', - 'type' => 'application/rss+xml', - 'title' => t('RSS - blogs'), - 'href' => url("blog/feed"))); return $output; } diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 32dc7ebe17cb53e1516bb28faf7d588f45daac17..9b5be7b1275c1ca4876aecb78813469fab416677 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -930,13 +930,8 @@ function theme_forum_display($forums, $topics, $parents, $tid, $sortby, $forum_p $output .= theme('forum_list', $forums, $parents, $tid); if ($tid && !in_array($tid, variable_get('forum_containers', array()))) { - drupal_add_link(array('rel' => 'alternate', - 'type' => 'application/rss+xml', - 'title' => 'RSS - '. $title, - 'href' => url('taxonomy/term/'. $tid .'/0/feed'))); - $output .= theme('forum_topic_list', $tid, $topics, $sortby, $forum_per_page); - drupal_add_feed(url('taxonomy/term/'. $tid .'/0/feed')); + drupal_add_feed(url('taxonomy/term/'. $tid .'/0/feed'), 'RSS - '. $title); } $output .= '</div>'; } diff --git a/modules/node/node.module b/modules/node/node.module index 237354ab8b9f72c31f19732eee807ec78a98b7e3..98505d38d8c404e434ed70e6abeb3c3fe72433ff 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -2257,11 +2257,7 @@ function node_page_default() { if (db_num_rows($result)) { $feed_url = url('rss.xml', NULL, NULL, TRUE); - drupal_add_feed($feed_url); - drupal_add_link(array('rel' => 'alternate', - 'type' => 'application/rss+xml', - 'title' => t('RSS'), - 'href' => $feed_url)); + drupal_add_feed($feed_url, t('RSS')); $output = ''; while ($node = db_fetch_object($result)) { diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 18ba091b31269f9b6df02483121588579daf7e1c..c0e4bc48cf63d314b3ae806b60a926c0392ca6ff 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -1251,13 +1251,8 @@ function taxonomy_term_page($str_tids = '', $depth = 0, $op = 'page') { $breadcrumbs = array_reverse($breadcrumbs); menu_set_location($breadcrumbs); - drupal_add_link(array('rel' => 'alternate', - 'type' => 'application/rss+xml', - 'title' => 'RSS - '. $title, - 'href' => url('taxonomy/term/'. $str_tids .'/'. $depth .'/feed'))); - $output = taxonomy_render_nodes(taxonomy_select_nodes($tids, $terms['operator'], $depth, TRUE)); - drupal_add_feed(url('taxonomy/term/'. $str_tids .'/'. $depth .'/feed')); + drupal_add_feed(url('taxonomy/term/'. $str_tids .'/'. $depth .'/feed'), 'RSS - '. $title); return $output; break;