diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-06-14 12:09:47 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-06-14 12:09:47 -0700 |
commit | 76b89556fc138dce694178fab9140a8242ea40ec (patch) | |
tree | 8a15489a8070aabfe2b19f7b4f5afa790326df82 /modules | |
parent | 484796e7cc54c3690462ee061850b563c4d5da16 (diff) |
Remove the sidebar flag from the feed definition returned by available_feeds and
replace with a type field with one of two values (head and block). We need to
do this to determine what fields go in the rss block so we can ignore the
definitions that are related to the page head when creating the rss block that
goes into the sidebar.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/comment/helpers/comment_rss.php | 4 | ||||
-rw-r--r-- | modules/gallery/helpers/gallery_rss.php | 4 | ||||
-rw-r--r-- | modules/rss/helpers/rss.php | 7 | ||||
-rw-r--r-- | modules/tag/helpers/tag_rss.php | 2 |
4 files changed, 8 insertions, 9 deletions
diff --git a/modules/comment/helpers/comment_rss.php b/modules/comment/helpers/comment_rss.php index b191c326..2e958eef 100644 --- a/modules/comment/helpers/comment_rss.php +++ b/modules/comment/helpers/comment_rss.php @@ -21,10 +21,10 @@ class comment_rss_Core { static function available_feeds($item) { return array(array("description" => t("All new comments"), - "sidebar" => true, + "type" => "block", "uri" => "comments"), array("description" => sprintf(t("Comments on %s"), $item->title), - "sidebar" => true, + "type" => "block", "uri" => "comments/{$item->id}")); } diff --git a/modules/gallery/helpers/gallery_rss.php b/modules/gallery/helpers/gallery_rss.php index 6e722ff6..455e210f 100644 --- a/modules/gallery/helpers/gallery_rss.php +++ b/modules/gallery/helpers/gallery_rss.php @@ -21,10 +21,10 @@ class gallery_rss_Core { static function available_feeds($item) { return array(array("description" => t("New photos or movies"), - "sidebar" => true, + "type" => "block", "uri" => "updates"), array("description" => t("Album feed"), - "sidebar" => false, + "type" => "head", "uri" => "albums")); } diff --git a/modules/rss/helpers/rss.php b/modules/rss/helpers/rss.php index e4d6f5e9..403ee225 100644 --- a/modules/rss/helpers/rss.php +++ b/modules/rss/helpers/rss.php @@ -27,16 +27,15 @@ class rss_Core { /** * Get all available rss feeds */ - static function available_feeds($item, $sidebar_only=true) { + static function available_feeds($item) { $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; + if ($feed["type"] == "block") { + $feeds[$feed["description"]] = url::site("rss/feed/{$feed['uri']}"); } - $feeds[$feed["description"]] = url::site("rss/feed/{$feed['uri']}"); } } } diff --git a/modules/tag/helpers/tag_rss.php b/modules/tag/helpers/tag_rss.php index ace7fd6a..7846edf6 100644 --- a/modules/tag/helpers/tag_rss.php +++ b/modules/tag/helpers/tag_rss.php @@ -21,7 +21,7 @@ class tag_rss_Core { static function available_feeds($item) { return array(array("description" => t("Tag Album feed"), - "sidebar" => false, + "type" => "head", "uri" => "tags")); } |