summaryrefslogtreecommitdiff
path: root/modules/rss/helpers/rss.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-06-12 22:46:42 +0800
committer <unostar@danalan.info>2009-06-13 04:22:25 +0800
commit94dc6baa4961a178ab68dc4cb0ce7a9bcba0ab26 (patch)
tree9a72beb30b1c2dc5c0e7fdeded4f557bd566c0ef /modules/rss/helpers/rss.php
parent0da812fdb0188d34a21b2b486c52699959909892 (diff)
Change from an event driven model to a call driven model similiar to the task
api. Signed-off-by: <unostar@danalan.info>
Diffstat (limited to 'modules/rss/helpers/rss.php')
-rw-r--r--modules/rss/helpers/rss.php21
1 files changed, 21 insertions, 0 deletions
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