summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/photos.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/controllers/photos.php')
-rw-r--r--modules/gallery/controllers/photos.php24
1 files changed, 4 insertions, 20 deletions
diff --git a/modules/gallery/controllers/photos.php b/modules/gallery/controllers/photos.php
index 054300a1..7e78b205 100644
--- a/modules/gallery/controllers/photos.php
+++ b/modules/gallery/controllers/photos.php
@@ -27,27 +27,11 @@ 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(),
- "next_item" => $next_item,
- "previous_item" => $previous_item,
- "sibling_count" => $photo->parent()->viewable()->children_count($where),
- "position" => $position));
-
+ $template->set_global(array("item" => $photo,
+ "children" => array(),
+ "children_count" => 0));
+ $template->set_global(item::get_display_context($photo));
$template->content = new View("photo.html");
$photo->increment_view_count();