From 1e6769307f0784c249cd98b857085adbca039627 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Sat, 4 Apr 2009 14:35:09 +0000 Subject: trying to cleanup select area code --- views/default/object/image.php | 279 ++++++++++++++--------------------------- 1 file changed, 92 insertions(+), 187 deletions(-) (limited to 'views/default/object') diff --git a/views/default/object/image.php b/views/default/object/image.php index c7bf408d5..383af4b4d 100644 --- a/views/default/object/image.php +++ b/views/default/object/image.php @@ -15,7 +15,7 @@ $mime = $file->mimetype; - if (get_context() == "search") { //if this is the search view + if (get_context() == "search") { //if this is the search view if (get_input('search_viewtype') == "gallery") { ?> @@ -36,52 +36,88 @@ echo elgg_view_listing($icon, $info); } - } else { - //tidypics image display - - if (!$vars['full']) { //simple gallery view - + } else { + + if (!$vars['full']) { + +//simple gallery view ?> -
- thumbnail -
+
+ thumbnail +
'; - + } else { + +//////////////////////////////////////////////////////// +// +// tidypics individual image display +// +//////////////////////////////////////////////////////// + + + // Build back and next links + + $back = ''; + $next = ''; + $album = get_entity($file->container_guid); - - //compile back | next links + $current = array_search($file_guid, $_SESSION['image_sort']); - + if (!$current) { // means we are no longer using the correct album array - - //rebuild the array -> + + //rebuild the array $count = get_entities("object","image", $album->guid, '', 999); $_SESSION['image_sort'] = array(); - - foreach($count as $image){ + + foreach ($count as $image) { array_push($_SESSION['image_sort'], $image->guid); - } + } - $current = array_search($file_guid, $_SESSION['image_sort']); + $current = array_search($file_guid, $_SESSION['image_sort']); } - if (!$current == 0) - $back = '<<' . elgg_echo('image:back') . '  '; + if ($current != 0) + $back = '<<' . elgg_echo('image:back') . ''; - if (array_key_exists(($current+1), $_SESSION['image_sort'])) - $next = '  ' . elgg_echo('image:next') . '>>'; + if (sizeof($_SESSION['image_sort']) > $current) + $next = '' . elgg_echo('image:next') . '>>'; + -?> +?> +
+
-' . autop($desc) . '
'; - echo '
'; - echo '
' . $back . $next . '
'; +
+ +
+
+ +
+
+
+ '; ?>
+
+
+
+
+
    +
  • +
  • +
+
+
+ +
$tags));?>
+ name; ?> +
+
@@ -93,155 +129,20 @@
-getGUID(), false, 'user', '', 0); - -?> -
-
-"; - $content .= ""; - - $content .= " -
- -
"; - - echo elgg_view('input/form', array('internalid' => 'quicksearch', 'internalname' => 'form-phototagging', 'class' => 'quicksearch', 'action' => "{$vars['url']}action/tidypics/phototagging", 'body' => $content)) -?> -
- -if ($photo_tags) foreach ($photo_tags as $photo_tag) -{ - $data_tag = unserialize($photo_tag->value); - - - if($data_tag->type == 'user') - $data_tag->data = get_entity($data_tag->value); - else - $data_tag->data = $data_tag->value; - - echo "
"; - if($data_tag->type == 'user') - echo "{$data_tag->data->name}"; - else - echo "{$data_tag->data}"; - echo ""; - echo "
"; -}else -{ - echo "
"; -} - - if ($next) - $click = "onclick='toggleLink()'"; - - echo '' . $title . ''; - -?> -
- -
- -
-
    -
  • -
  • -
-
- - -
-

-
    -value); - - $name = ""; - - $object = new stdClass(); - - if($data_tag->type == 'user') - { - $data_tag->data = get_entity($data_tag->value); - $object->img = elgg_view("profile/icon",array('entity' => $data_tag->data, 'size' => 'topbar', 'override' => true)); - $object->name = $data_tag->data->name; - $object->rel = $data_tag->data->getUrl(); - }else - { - $data_tag->data = $data_tag->value; - $object->img = ""; - $object->name = $data_tag->data; - $object->rel = "#"; - } - - $object->html = "
  • $object->img{$object->name}
  • "; - - if($data_tag->type == 'user') - $users[] = $object; - - else - $objects[] = $object; - } - - if(!empty($users)) foreach ($users as $user) - echo $user->html; - - if(!empty($objects)) foreach ($objects as $object) - echo $object->html; - -?> -
-
- - - -
- -
$tags));?>
- - name; ?>
-
'; - } - - } // end of tidypics image display + echo '
'; // content wrapper + } // // end of individual image display + + } ?> - - + +