From 9dbe2e15ad9db3b2be53e46bc5f67d382fb4089d Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 9 Feb 2013 14:53:34 -0500 Subject: Extend siblings callbacks to take a $limit and an $offset for navigating large sibling sets. Useful for the thumbnav module since we don't want to iterate a thousand siblings to find the one we care about. Fixes #1999. --- modules/gallery/controllers/albums.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/gallery/controllers') diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php index d545b415..0fb033a8 100644 --- a/modules/gallery/controllers/albums.php +++ b/modules/gallery/controllers/albums.php @@ -98,9 +98,9 @@ class Albums_Controller extends Items_Controller { "breadcrumbs" => Breadcrumb::array_from_item_parents($item)); } - static function get_siblings($item) { + static function get_siblings($item, $limit=null, $offset=null) { // @todo consider creating Item_Model::siblings() if we use this more broadly. - return $item->parent()->viewable()->children(); + return $item->parent()->viewable()->children($limit, $offset); } public function create($parent_id) { -- cgit v1.2.3