summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/gallery_rss.php21
1 files changed, 20 insertions, 1 deletions
diff --git a/modules/gallery/helpers/gallery_rss.php b/modules/gallery/helpers/gallery_rss.php
index 98798346..6e722ff6 100644
--- a/modules/gallery/helpers/gallery_rss.php
+++ b/modules/gallery/helpers/gallery_rss.php
@@ -22,7 +22,10 @@ class gallery_rss_Core {
static function available_feeds($item) {
return array(array("description" => t("New photos or movies"),
"sidebar" => true,
- "uri" => "updates"));
+ "uri" => "updates"),
+ array("description" => t("Album feed"),
+ "sidebar" => false,
+ "uri" => "albums"));
}
static function updates($offset, $limit) {
@@ -39,4 +42,20 @@ class gallery_rss_Core {
return $feed;
}
+
+ static function albums($offset, $limit, $id) {
+ $item = ORM::factory("item", $id);
+ access::required("view", $item);
+
+ $feed = new stdClass();
+ $feed->data["children"] = $item
+ ->viewable()
+ ->descendants($limit, $offset, "photo");
+ $feed->max_pages = ceil($item->viewable()->descendants_count("photo") / $limit);
+ $feed->data["title"] = $item->title;
+ $feed->data["link"] = url::abs_site("albums/{$item->id}");
+ $feed->data["description"] = $item->description;
+
+ return $feed;
+ }
}