summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/common.inc28
-rw-r--r--includes/theme.inc1
2 files changed, 29 insertions, 0 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>';