diff options
author | Nathan Kinkade <nath@nkinka.de> | 2012-04-16 21:42:16 +0000 |
---|---|---|
committer | Nathan Kinkade <nath@nkinka.de> | 2012-04-16 21:42:16 +0000 |
commit | a13fd7f373f3718037a2ce90a3cb408f24856602 (patch) | |
tree | c3db8fc6addfe5d3c6718d33e8fec024ef960318 /modules/comment/helpers/comment_rss.php | |
parent | b95f4776fd6999242435d547c29944861e1c2c41 (diff) | |
parent | a6a07c8580aa09063e39c407922a2cc197b4f05c (diff) |
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/comment/helpers/comment_rss.php')
-rw-r--r-- | modules/comment/helpers/comment_rss.php | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/modules/comment/helpers/comment_rss.php b/modules/comment/helpers/comment_rss.php index 6434448f..cfee4727 100644 --- a/modules/comment/helpers/comment_rss.php +++ b/modules/comment/helpers/comment_rss.php @@ -19,9 +19,23 @@ */ class comment_rss_Core { + static function feed_visible($feed_id) { + $visible = module::get_var("comment", "rss_visible"); + if (!in_array($feed_id, array("newest", "per_item"))) { + return false; + } + + return ($visible == "all" || $visible == $feed_id); + } + static function available_feeds($item, $tag) { - $feeds["comment/newest"] = t("All new comments"); - if ($item) { + $feeds = array(); + + if (comment_rss::feed_visible("newest")) { + $feeds["comment/newest"] = t("All new comments"); + } + + if ($item && comment_rss::feed_visible("per_item")) { $feeds["comment/item/$item->id"] = t("Comments on %title", array("title" => html::purify($item->title))); } @@ -29,7 +43,7 @@ class comment_rss_Core { } static function feed($feed_id, $offset, $limit, $id) { - if ($feed_id != "newest" && $feed_id != "item") { + if (!comment_rss::feed_visible($feed_id)) { return; } |