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/album.php | 25 ++++++------------------- views/default/object/image.php | 30 ++++++++---------------------- 2 files changed, 14 insertions(+), 41 deletions(-) (limited to 'views/default/object') diff --git a/views/default/object/album.php b/views/default/object/album.php index 0db0d3e49..b87bef444 100644 --- a/views/default/object/album.php +++ b/views/default/object/album.php @@ -106,24 +106,11 @@ if (get_context() == "search") { ' . autop($desc) . ''; - $images = get_entities("object", "image", $album_guid, '', 999); - - //build array for back | next links - $_SESSION['image_sort'] = array(); - - if (is_array($images)) { - foreach ($images as $image) { - array_push($_SESSION['image_sort'], $image->guid); - } - - // display the simple image views. Uses 'object/image' view - echo list_entities("object", "image", $album_guid, 24, false); - - $num_images = count($images); - } else { - echo '
' . elgg_echo('image:none') . '
'; - $num_images = 0; - } + $offset = (int)get_input('offset', 0); + echo $album->viewImages(8, $offset); + // echo '
' . elgg_echo('image:none') . '
'; + // $num_images = 0; + //} ?>
@@ -137,7 +124,7 @@ if (get_context() == "search") { } ?> name; ?>
-
+ getSize(); ?>
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