diff options
| author | Nathan Kinkade <nath@nkinka.de> | 2011-09-28 20:39:05 +0000 |
|---|---|---|
| committer | Nathan Kinkade <nath@nkinka.de> | 2011-09-28 20:39:05 +0000 |
| commit | 47456c0de8a408bca9b5a02a0fbc835ff1c01a68 (patch) | |
| tree | dca2ead5e7159b28aa323465a363f81813f75acd /modules/gallery/controllers/albums.php | |
| parent | d8dffba94277c2179a59eb72d6927a5bdb879648 (diff) | |
| parent | dfbfe090168ee4ed44e2c8208e79d3fe40f90437 (diff) | |
Manually fixed a merge conflict after pulling.
Diffstat (limited to 'modules/gallery/controllers/albums.php')
| -rw-r--r-- | modules/gallery/controllers/albums.php | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php index 1c48c734..8aa3bb35 100644 --- a/modules/gallery/controllers/albums.php +++ b/modules/gallery/controllers/albums.php @@ -72,10 +72,29 @@ class Albums_Controller extends Items_Controller { "breadcrumbs" => Breadcrumb::array_from_item_parents($album), "children_count" => $children_count)); $template->content = new View("album.html"); - $album->increment_view_count(); print $template; + item::set_display_context_callback("Albums_Controller::get_display_context"); + } + + static function get_display_context($item) { + $where = array(array("type", "!=", "album")); + $position = item::get_position($item, $where); + if ($position > 1) { + list ($previous_item, $ignore, $next_item) = + $item->parent()->viewable()->children(3, $position - 2, $where); + } else { + $previous_item = null; + list ($next_item) = $item->parent()->viewable()->children(1, $position, $where); + } + + return array("position" => $position, + "previous_item" => $previous_item, + "next_item" => $next_item, + "sibling_count" => $item->parent()->viewable()->children_count($where), + "parents" => $item->parents()->as_array(), + "breadcrumbs" => Breadcrumb::array_from_item_parents($item)); } public function create($parent_id) { |
