summaryrefslogtreecommitdiff
path: root/modules/media_rss/controllers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2008-11-19 18:23:30 +0000
committerTim Almdal <tnalmdal@shaw.ca>2008-11-19 18:23:30 +0000
commitb3314fc1dcfd73c36c4bab82a5ebabca629845c8 (patch)
tree0f2a53f914302f59a7c8215884b0a6482abbd1b2 /modules/media_rss/controllers
parent161998dde6d976c45cfcea31f1128147acc3d64f (diff)
Update the media rss template to include the resize and the fullsize
added descendants by type method to the item model to allow for the selection of children by type
Diffstat (limited to 'modules/media_rss/controllers')
-rw-r--r--modules/media_rss/controllers/media_rss.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/modules/media_rss/controllers/media_rss.php b/modules/media_rss/controllers/media_rss.php
index e6b499ea..f88e7004 100644
--- a/modules/media_rss/controllers/media_rss.php
+++ b/modules/media_rss/controllers/media_rss.php
@@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Media_RSS_Controller extends Controller {
+ public static $LIMIT = 10;
public function feed($id) {
$item = ORM::factory("item", $id)->find();
if (!$item->loaded) {
@@ -27,11 +28,15 @@ class Media_RSS_Controller extends Controller {
$view = new View("feed.mrss");
$view->item = $item;
- // This should probably be a method in ORM_MPTT
- $view->children = ORM::factory("item")
- ->where("parent_id", $item->id)
- ->where("type", "photo")
- ->find_all();
+ $offset = $this->input->get("offset", 0);
+ $view->children = $item->decendents_by_type("photo", Media_RSS_Controller::$LIMIT, $offset);
+
+ if (!empty($offset)) {
+ $view->prevOffset = $offset - Media_RSS_Controller::$LIMIT;
+ }
+ if ($view->children->count() >= Media_RSS_Controller::$LIMIT) {
+ $view->nextOffset = $offset + Media_RSS_Controller::$LIMIT;
+ }
header("Content-type: application/rss+xml");
print $view;