diff options
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 28 |
1 files changed, 28 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 * @{ |