diff options
Diffstat (limited to 'modules/gallery/controllers/photos.php')
-rw-r--r-- | modules/gallery/controllers/photos.php | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/modules/gallery/controllers/photos.php b/modules/gallery/controllers/photos.php index af8aed16..49bb5a25 100644 --- a/modules/gallery/controllers/photos.php +++ b/modules/gallery/controllers/photos.php @@ -27,27 +27,12 @@ class Photos_Controller extends Items_Controller { access::required("view", $photo); - $where = array(array("type", "!=", "album")); - $position = item::get_position($photo, $where); - if ($position > 1) { - list ($previous_item, $ignore, $next_item) = - $photo->parent()->viewable()->children(3, $position - 2, $where); - } else { - $previous_item = null; - list ($next_item) = $photo->parent()->viewable()->children(1, $position, $where); - } - $template = new Theme_View("page.html", "item", "photo"); $template->set_global( - array("item" => $photo, - "children" => array(), - "children_count" => 0, - "parents" => $photo->parents()->as_array(), - "breadcrumbs" => Breadcrumb::array_from_item_parents($photo), - "next_item" => $next_item, - "previous_item" => $previous_item, - "sibling_count" => $photo->parent()->viewable()->children_count($where), - "position" => $position)); + array_merge(array("item" => $photo, + "children" => array(), + "children_count" => 0), + Display_Context::factory()->display_context($photo))); $template->content = new View("photo.html"); |