summaryrefslogtreecommitdiff
path: root/modules/gallery
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2013-01-30 12:10:18 -0500
committerBharat Mediratta <bharat@menalto.com>2013-01-30 12:10:18 -0500
commit1e4d75c12072b49c3469f18af13bcf3439afc6b0 (patch)
treed2d77c86e0f37bd9d56b4a86cec390f8119e476e /modules/gallery
parenta983e8748e6e6667e968e96f8f0994f49b763b73 (diff)
Improve the display context API to return a "siblings_callback" field
containing a callback that returns all the siblings. Fixes #1975.
Diffstat (limited to 'modules/gallery')
-rw-r--r--modules/gallery/controllers/albums.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php
index e14fe347..d545b415 100644
--- a/modules/gallery/controllers/albums.php
+++ b/modules/gallery/controllers/albums.php
@@ -93,10 +93,16 @@ class Albums_Controller extends Items_Controller {
"previous_item" => $previous_item,
"next_item" => $next_item,
"sibling_count" => $item->parent()->viewable()->children_count($where),
+ "siblings_callback" => array("Albums_Controller::get_siblings", array($item)),
"parents" => $item->parents()->as_array(),
"breadcrumbs" => Breadcrumb::array_from_item_parents($item));
}
+ static function get_siblings($item) {
+ // @todo consider creating Item_Model::siblings() if we use this more broadly.
+ return $item->parent()->viewable()->children();
+ }
+
public function create($parent_id) {
access::verify_csrf();
$album = ORM::factory("item", $parent_id);