diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-06-10 08:26:40 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-06-10 08:26:40 -0700 |
commit | 0c5cb026a72c3e894cbb7c6a637267f867cc323a (patch) | |
tree | b605057df232b5d510ededaeed9aedc4913a718f /modules | |
parent | a3c9104568704b5e626c9ac9b95921c8a67ef79a (diff) |
Only add the comment rss feeds if the comment module is active. fix for #365
Diffstat (limited to 'modules')
-rw-r--r-- | modules/rss/helpers/rss_theme.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/modules/rss/helpers/rss_theme.php b/modules/rss/helpers/rss_theme.php index d47d3313..54bba210 100644 --- a/modules/rss/helpers/rss_theme.php +++ b/modules/rss/helpers/rss_theme.php @@ -40,12 +40,16 @@ class rss_theme_Core { $block->css_id = "gRss"; $block->title = t("Available RSS Feeds"); $block->content = new View("rss_block.html"); - $block->content->feeds = array( - t("New photos or movies") => url::site("rss/updates"), - t("All new comments") => url::site("rss/comments"), - sprintf(t("Comments on %s"), - $theme->item()->title) => url::site("rss/comments/{$theme->item()->id}") - ); + // @todo consider pushing the code for the feeds back to the associated modules + // and create an event 'generate_rss_feeds' that modules can respond to create + // the list of feeds. + $feeds = array(t("New photos or movies") => url::site("rss/updates")); + if (module::is_active("comment")) { + $feeds[t("All new comments")] = url::site("rss/comments"); + $feeds[sprintf(t("Comments on %s"), $theme->item()->title)] = + url::site("rss/comments/{$theme->item()->id}"); + } + $block->content->feeds = $feeds; return $block; } } |