From fd3a81f1ee9b1621f5be62ac4e7f595f7aa83fc0 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Fri, 12 Jun 2009 23:52:03 +0800 Subject: Move the processing of rss feeds from the rss controller to callbacks in the modules that are supplying the feed. The rss controller becomes a router. In this change the comment and updates fields are distributed. Signed-off-by: --- modules/gallery/helpers/gallery_rss.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'modules/gallery/helpers') diff --git a/modules/gallery/helpers/gallery_rss.php b/modules/gallery/helpers/gallery_rss.php index 0b87b1b1..98798346 100644 --- a/modules/gallery/helpers/gallery_rss.php +++ b/modules/gallery/helpers/gallery_rss.php @@ -24,4 +24,19 @@ class gallery_rss_Core { "sidebar" => true, "uri" => "updates")); } + + static function updates($offset, $limit) { + $feed = new stdClass(); + $feed->data["children"] = ORM::factory("item") + ->viewable() + ->where("type !=", "album") + ->orderby("created", "DESC") + ->find_all($limit, $offset); + $feed->max_pages = ceil($feed->data["children"]->count() / $limit); + $feed->data["title"] = t("Recent Updates"); + $feed->data["link"] = url::abs_site("albums/1"); + $feed->data["description"] = t("Recent Updates"); + + return $feed; + } } -- cgit v1.2.3