From fc56ebd4346b1e4515388ec8570f26deea7fd500 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 31 Dec 2008 07:22:35 +0000 Subject: 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) --- core/controllers/photos.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core') 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); -- cgit v1.2.3