summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2008-12-31 07:22:35 +0000
committerBharat Mediratta <bharat@menalto.com>2008-12-31 07:22:35 +0000
commitfc56ebd4346b1e4515388ec8570f26deea7fd500 (patch)
tree7fe58e733a087b934c2a3aefc02076edd6724844 /core
parent77bb22a65c64bd5bae1a304051e1e19bd3993b52 (diff)
Simplify the next/previous logic in the theme by passing in a null
next/prev sib if one didn't exist. (that's what we were supposed to be doing in the first place, anyway)
Diffstat (limited to 'core')
-rw-r--r--core/controllers/photos.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/controllers/photos.php b/core/controllers/photos.php
index 82f9b779..d59ce26d 100644
--- a/core/controllers/photos.php
+++ b/core/controllers/photos.php
@@ -49,8 +49,8 @@ class Photos_Controller extends Items_Controller {
$template->set_global("children", array());
$template->set_global("children_count", $photo->children_count());
$template->set_global("parents", $photo->parents());
- $template->set_global("next_item", $next_item);
- $template->set_global("previous_item", $previous_item);
+ $template->set_global("next_item", $next_item->loaded ? $next_item : null);
+ $template->set_global("previous_item", $previous_item->loaded ? $previous_item : null);
$template->set_global("sibling_count", $photo->parent()->children_count());
$template->set_global("position", $position);