item()) { $url = rss::item_feed($theme->item()); } else if ($theme->tag()) { $url = rss::tag_feed($theme->tag()); } if (!empty($url)) { return ""; } } static function sidebar_blocks($theme) { // @todo this needs to be data driven if (!$theme->item()) { return; } $block = new Block(); $block->css_id = "gRss"; $block->title = t("Available RSS Feeds"); $block->content = new View("rss_block.html"); // @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; } }