summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-06-15 03:09:47 +0800
committer <unostar@danalan.info>2009-06-15 04:26:03 +0800
commit6007843c4acf3a83580989351de73ae64a2e61ed (patch)
tree2529f14ad07c942fffd4127af4a1c3f7e785db1d
parentfdbffc870d84ec035068420f5a8b4292d7aade13 (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. Signed-off-by: <unostar@danalan.info>
-rw-r--r--modules/comment/helpers/comment_rss.php4
-rw-r--r--modules/gallery/helpers/gallery_rss.php4
-rw-r--r--modules/rss/helpers/rss.php7
-rw-r--r--modules/tag/helpers/tag_rss.php2
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"));
}