summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Drumm <drumm@3064.no-reply.drupal.org>2006-08-23 05:55:38 +0000
committerNeil Drumm <drumm@3064.no-reply.drupal.org>2006-08-23 05:55:38 +0000
commita58d877108f6b7ff6712c6261815c6092c7f6949 (patch)
tree6c76f23e2bc4caf442d7643f3fe0fd189c20f3f4
parent32e22f1f9a69618ba94e2015cf4f9d5c8ebb80e1 (diff)
downloadbrdo-a58d877108f6b7ff6712c6261815c6092c7f6949.tar.gz
brdo-a58d877108f6b7ff6712c6261815c6092c7f6949.tar.bz2
#66569 by m3avrck. Put all the feed icons in the same place.
-rw-r--r--includes/common.inc28
-rw-r--r--includes/theme.inc1
-rw-r--r--modules/aggregator/aggregator.module5
-rw-r--r--modules/blog/blog.module6
-rw-r--r--modules/forum/forum.module2
-rw-r--r--modules/node/node.module4
-rw-r--r--modules/taxonomy/taxonomy.module2
-rw-r--r--themes/bluemarine/page.tpl.php1
-rw-r--r--themes/chameleon/chameleon.theme1
-rw-r--r--themes/engines/phptemplate/phptemplate.engine1
-rw-r--r--themes/pushbutton/page.tpl.php3
11 files changed, 44 insertions, 10 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 79bf69b0e..c9de3a434 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -148,6 +148,34 @@ function drupal_get_headers() {
return drupal_set_header();
}
+/*
+ * Add a feed URL for the current page.
+ *
+ * @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()
+ */
+function drupal_add_feed($url = NULL, $theme_function = 'feed_icon') {
+ static $stored_feed_links = array();
+
+ if (!is_null($url)) {
+ $stored_feed_links[$url] = theme($theme_function, $url);
+ }
+ return $stored_feed_links;
+}
+
+/**
+ * Get the feed URLs for the current page.
+ *
+ * @param $delimiter
+ * The delimiter to split feeds by
+ */
+function drupal_get_feeds($delimiter = "\n") {
+ $feeds = drupal_add_feed();
+ return implode($feeds, $delimiter);
+}
+
/**
* @name HTTP handling
* @{
diff --git a/includes/theme.inc b/includes/theme.inc
index 2635c4e14..124f187d7 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -387,6 +387,7 @@ function theme_page($content) {
$output .= "\n<!-- begin content -->\n";
$output .= $content;
+ $output .= drupal_get_feeds();
$output .= "\n<!-- end content -->\n";
$output .= '</td></tr></table>';
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index bcd08b8ef..e32f95c99 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -1085,11 +1085,12 @@ function aggregator_page_list($sql, $header, $categorize) {
// arg(1) is undefined if we are at the top aggregator URL
// is there a better way to do this?
if (!arg(1)) {
- $form['feed_icon'] = array('#value' => theme('feed_icon', url('aggregator/rss')));
+ drupal_add_feed(url('aggregator/rss'));
}
elseif (arg(1) == 'categories' && arg(2) && !arg(3)) {
- $form['feed_icon'] = array('#value' => theme('feed_icon', url('aggregator/rss/' . arg(2))));
+ drupal_add_feed(url('aggregator/rss/'. arg(2)));
}
+
return $form;
}
diff --git a/modules/blog/blog.module b/modules/blog/blog.module
index b4892e738..b0227e66d 100644
--- a/modules/blog/blog.module
+++ b/modules/blog/blog.module
@@ -163,7 +163,7 @@ function blog_page_user($uid) {
$output .= node_view(node_load($node->nid), 1);
}
$output .= theme('pager', NULL, variable_get('default_nodes_main', 10));
- $output .= theme('feed_icon', url("blog/$account->uid/feed"));
+ drupal_add_feed(url('blog/'. $account->uid .'/feed'));
drupal_add_link(array('rel' => 'alternate',
'type' => 'application/rss+xml',
@@ -190,7 +190,7 @@ function blog_page_last() {
$output .= node_view(node_load($node->nid), 1);
}
$output .= theme('pager', NULL, variable_get('default_nodes_main', 10));
- $output .= theme('feed_icon', url('blog/feed'));
+ drupal_add_feed(url('blog/feed'));
drupal_add_link(array('rel' => 'alternate',
'type' => 'application/rss+xml',
@@ -310,5 +310,3 @@ function blog_block($op = 'list', $delta = 0) {
}
}
}
-
-
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index 71cf6c960..32dc7ebe1 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -936,7 +936,7 @@ function theme_forum_display($forums, $topics, $parents, $tid, $sortby, $forum_p
'href' => url('taxonomy/term/'. $tid .'/0/feed')));
$output .= theme('forum_topic_list', $tid, $topics, $sortby, $forum_per_page);
- $output .= theme('feed_icon', url("taxonomy/term/$tid/0/feed"));
+ drupal_add_feed(url('taxonomy/term/'. $tid .'/0/feed'));
}
$output .= '</div>';
}
diff --git a/modules/node/node.module b/modules/node/node.module
index b8ed3c4e2..237354ab8 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -2256,10 +2256,12 @@ function node_page_default() {
$result = pager_query(db_rewrite_sql('SELECT n.nid, n.sticky, n.created FROM {node} n WHERE n.promote = 1 AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC'), variable_get('default_nodes_main', 10));
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' => url('rss.xml', NULL, NULL, TRUE)));
+ 'href' => $feed_url));
$output = '';
while ($node = db_fetch_object($result)) {
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index 6d93a43fc..18ba091b3 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -1257,7 +1257,7 @@ function taxonomy_term_page($str_tids = '', $depth = 0, $op = 'page') {
'href' => url('taxonomy/term/'. $str_tids .'/'. $depth .'/feed')));
$output = taxonomy_render_nodes(taxonomy_select_nodes($tids, $terms['operator'], $depth, TRUE));
- $output .= theme('feed_icon', url('taxonomy/term/'. $str_tids .'/'. $depth .'/feed'));
+ drupal_add_feed(url('taxonomy/term/'. $str_tids .'/'. $depth .'/feed'));
return $output;
break;
diff --git a/themes/bluemarine/page.tpl.php b/themes/bluemarine/page.tpl.php
index 385df6fa9..88b255398 100644
--- a/themes/bluemarine/page.tpl.php
+++ b/themes/bluemarine/page.tpl.php
@@ -43,6 +43,7 @@
<?php print $help ?>
<?php print $messages ?>
<?php print $content; ?>
+ <?php print $feed_icons; ?>
</div>
</td>
<?php if ($sidebar_right) { ?><td id="sidebar-right">
diff --git a/themes/chameleon/chameleon.theme b/themes/chameleon/chameleon.theme
index 056ffdf4c..9ffa50ef0 100644
--- a/themes/chameleon/chameleon.theme
+++ b/themes/chameleon/chameleon.theme
@@ -92,6 +92,7 @@ function chameleon_page($content) {
$output .= "\n<!-- begin content -->\n";
$output .= $content;
+ $output .= drupal_get_feeds();
$output .= "\n<!-- end content -->\n";
if ($footer = variable_get('site_footer', '')) {
diff --git a/themes/engines/phptemplate/phptemplate.engine b/themes/engines/phptemplate/phptemplate.engine
index 7533888fc..744563ad9 100644
--- a/themes/engines/phptemplate/phptemplate.engine
+++ b/themes/engines/phptemplate/phptemplate.engine
@@ -196,6 +196,7 @@ function phptemplate_page($content) {
'breadcrumb' => theme('breadcrumb', drupal_get_breadcrumb()),
'closure' => theme('closure'),
'content' => '<!-- begin content -->' . $content . '<!-- end content -->',
+ 'feed_icons' => drupal_get_feeds(),
'footer_message' => filter_xss_admin(variable_get('site_footer', FALSE)) . "\n" . theme('blocks', 'footer'),
'head' => drupal_get_html_head(),
'head_title' => implode(' | ', $head_title),
diff --git a/themes/pushbutton/page.tpl.php b/themes/pushbutton/page.tpl.php
index 3b8219556..cdfe44771 100644
--- a/themes/pushbutton/page.tpl.php
+++ b/themes/pushbutton/page.tpl.php
@@ -81,7 +81,8 @@
<?php endif; ?>
<!-- start main content -->
- <?php print($content) ?>
+ <?php print $content; ?>
+ <?php print $feed_icons; ?>
<!-- end main content -->
</div><!-- main -->