From a1f08342c8b8502197159a9fd78e48e6cead4ea0 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 31 Jul 2010 19:22:47 +0000 Subject: improved the upgrade system and moved albums to use an ordered list for images --- views/default/object/image.php | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) (limited to 'views/default/object/image.php') diff --git a/views/default/object/image.php b/views/default/object/image.php index cd53120de..da3e257a1 100644 --- a/views/default/object/image.php +++ b/views/default/object/image.php @@ -94,32 +94,18 @@ if (get_context() == "search") { // Build back and next links $back = ''; $next = ''; - $album = get_entity($image->container_guid); + $back_guid = $album->getPreviousImageGuid($image->guid); + $next_guid = $album->getNextImageGuid($image->guid); - $current = array_search($image_guid, $_SESSION['image_sort']); - - if (!$current) { // means we are no longer using the correct album array - - //rebuild the array - $count = get_entities("object","image", $album->guid, '', 999); - $_SESSION['image_sort'] = array(); - - foreach ($count as $img) { - array_push($_SESSION['image_sort'], $img->guid); - } - - if ($_SESSION['image_sort']) { - $current = array_search($image_guid, $_SESSION['image_sort']); - } - } - - if ($current != 0) { - $back = '« ' . elgg_echo('image:back') . ''; + if ($back_guid != 0) { + $text = elgg_echo('image:back'); + $back = "« $text"; } - if (sizeof($_SESSION['image_sort']) > $current + 1) { - $next = '' . elgg_echo('image:next') . ' »'; + if ($next_guid != 0) { + $text = elgg_echo('image:next'); + $next = "$text »"; } ?> -- cgit v1.2.3