From a58d877108f6b7ff6712c6261815c6092c7f6949 Mon Sep 17 00:00:00 2001 From: Neil Drumm Date: Wed, 23 Aug 2006 05:55:38 +0000 Subject: #66569 by m3avrck. Put all the feed icons in the same place. --- includes/common.inc | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'includes/common.inc') 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 * @{ -- cgit v1.2.3