From 94dc6baa4961a178ab68dc4cb0ce7a9bcba0ab26 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 12 Jun 2009 22:46:42 +0800 Subject: Change from an event driven model to a call driven model similiar to the task api. Signed-off-by: --- modules/rss/helpers/rss.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'modules/rss/helpers/rss.php') diff --git a/modules/rss/helpers/rss.php b/modules/rss/helpers/rss.php index b320aeae..b0e7b30f 100644 --- a/modules/rss/helpers/rss.php +++ b/modules/rss/helpers/rss.php @@ -27,4 +27,25 @@ class rss_Core { static function tag_feed($tag) { return url::site("rss/tags/$tag->id}"); } + + /** + * Get all available rss feeds + */ + static function get_feeds($item, $sidebar_only=true) { + $feeds = array(); + foreach (module::active() as $module) { + $class_name = "{$module->name}_rss"; + if (method_exists($class_name, "available_feeds")) { + foreach (call_user_func(array($class_name, "available_feeds"), $item) as $feed) { + if ($sidebar_only && !$feed["sidebar"]) { + continue; + } + $feeds[$feed["description"]] = url::site("rss/{$feed['uri']}"); + } + } + } + + return $feeds; + } + } \ No newline at end of file -- cgit v1.2.3