summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2011-08-11 22:11:24 -0700
committerTim Almdal <tnalmdal@shaw.ca>2011-08-11 22:11:24 -0700
commitc92d34a86b0515363f790056293cea2b0a738782 (patch)
tree9d5b794e434d26ef7ee50281b3ebee716e3327a5 /modules/gallery/controllers
parenta5b1972bbe9676479886ca94bb23f09407a87561 (diff)
parent933a34986dbca248f388e8aa3c3aea4a6d71a94b (diff)
Merge branch 'displayContext' into display_context_compressed
Conflicts: modules/gallery/controllers/movies.php modules/gallery/controllers/photos.php modules/tag/controllers/tag.php
Diffstat (limited to 'modules/gallery/controllers')
-rw-r--r--modules/gallery/controllers/albums.php3
-rw-r--r--modules/gallery/controllers/movies.php23
-rw-r--r--modules/gallery/controllers/photos.php23
3 files changed, 11 insertions, 38 deletions
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php
index 1c48c734..9bf7b9bf 100644
--- a/modules/gallery/controllers/albums.php
+++ b/modules/gallery/controllers/albums.php
@@ -60,6 +60,9 @@ class Albums_Controller extends Items_Controller {
url::redirect($album->abs_url("page=$max_pages"));
}
+ Display_Context::factory("item")
+ ->save();
+
$template = new Theme_View("page.html", "collection", "album");
$template->set_global(
array("page" => $page,
diff --git a/modules/gallery/controllers/movies.php b/modules/gallery/controllers/movies.php
index 0f12c3fb..bbf89f17 100644
--- a/modules/gallery/controllers/movies.php
+++ b/modules/gallery/controllers/movies.php
@@ -27,27 +27,12 @@ class Movies_Controller extends Items_Controller {
access::required("view", $movie);
- $where = array(array("type", "!=", "album"));
- $position = item::get_position($movie, $where);
- if ($position > 1) {
- list ($previous_item, $ignore, $next_item) =
- $movie->parent()->viewable()->children(3, $position - 2, $where);
- } else {
- $previous_item = null;
- list ($next_item) = $movie->parent()->viewable()->children(1, $position, $where);
- }
-
$template = new Theme_View("page.html", "item", "movie");
$template->set_global(
- array("item" => $movie,
- "children" => array(),
- "children_count" => 0,
- "parents" => $movie->parents()->as_array(),
- "breadcrumbs" => Breadcrumb::array_from_item_parents($movie),
- "next_item" => $next_item,
- "previous_item" => $previous_item,
- "sibling_count" => $movie->parent()->viewable()->children_count($where),
- "position" => $position));
+ array_merge(array("item" => $movie,
+ "children" => array(),
+ "children_count" => 0),
+ Display_Context::factory()->display_context($movie)));
$template->content = new View("movie.html");
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");