summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/photos.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2011-08-27 11:18:07 -0700
committerBharat Mediratta <bharat@menalto.com>2011-08-27 11:18:07 -0700
commitce43f29e2ceaac3d638061f81dc6037b5e0018d3 (patch)
treea578ffdd232d53b590b6dae68ff2bb35d6a813aa /modules/gallery/controllers/photos.php
parentc92d34a86b0515363f790056293cea2b0a738782 (diff)
Refactor the display context code a bit:
1) Move the display context code into the controller themselves so that it's more logically a continuation callback from the original controller rendering code. 2) Simplify the display context set/get code and put it in the item helper, it's just a couple of lines of code now. 3) Add more descriptive breadcrumb strings
Diffstat (limited to 'modules/gallery/controllers/photos.php')
-rw-r--r--modules/gallery/controllers/photos.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/modules/gallery/controllers/photos.php b/modules/gallery/controllers/photos.php
index 49bb5a25..7e78b205 100644
--- a/modules/gallery/controllers/photos.php
+++ b/modules/gallery/controllers/photos.php
@@ -28,12 +28,10 @@ class Photos_Controller extends Items_Controller {
access::required("view", $photo);
$template = new Theme_View("page.html", "item", "photo");
- $template->set_global(
- array_merge(array("item" => $photo,
- "children" => array(),
- "children_count" => 0),
- Display_Context::factory()->display_context($photo)));
-
+ $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();