diff options
author | Cash Costello <cash.costello@gmail.com> | 2009-03-21 17:53:07 +0000 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2009-03-21 17:53:07 +0000 |
commit | 26be16aaf2189a4b50b06494aab6c6690480a371 (patch) | |
tree | e9f8fc7030fbfd3f356278336629956daf669e47 | |
parent | 9cd649361936640a11c249443c6c8f4e00f2399d (diff) | |
download | elgg-26be16aaf2189a4b50b06494aab6c6690480a371.tar.gz elgg-26be16aaf2189a4b50b06494aab6c6690480a371.tar.bz2 |
finished updating display of single image
-rw-r--r-- | start.php | 2 | ||||
-rw-r--r-- | viewimage.php (renamed from view.php) | 26 | ||||
-rw-r--r-- | views/default/object/image.php | 97 |
3 files changed, 48 insertions, 77 deletions
@@ -120,7 +120,7 @@ case "view": //view an image individually
set_input('guid',$page[1]);
- include($CONFIG->pluginspath . "tidypics/view.php");
+ include($CONFIG->pluginspath . "tidypics/viewimage.php");
break;
case "album": //view an album individually
diff --git a/view.php b/viewimage.php index 60fb47864..85e8d8215 100644 --- a/view.php +++ b/viewimage.php @@ -11,12 +11,6 @@ // Get the GUID of the entity we want to view
$guid = (int) get_input('guid');
- $shell = get_input('shell');
- if ($shell == "no") {
- $shell = false;
- } else {
- $shell = true;
- }
$context = get_input('context');
if ($context) set_context($context);
@@ -33,24 +27,16 @@ set_page_owner($entity->owner_guid);
}
- // Set the body to be the full view of the entity, and the title to be its title
- $area2 = elgg_view_entity($entity,true);
- if ($shell) {
- $body = elgg_view_layout('two_column_left_sidebar', '', $area1 . $area2);
- } else {
- $body = $area2;
- }
+ $title = $entity->title;
+ $area2 = elgg_view_title($title);
+ $area2 .= elgg_view_entity($entity, true);
} else {
$body = elgg_echo('notfound');
}
- // Display the page
- if ($shell) {
- page_draw("", $body);
- } else {
- header("Content-type: text/html; charset=UTF-8");
- echo $body;
- }
+ $body = elgg_view_layout('two_column_left_sidebar', '', $area2);
+ // Display the page
+ page_draw($title, $body);
?>
\ No newline at end of file diff --git a/views/default/object/image.php b/views/default/object/image.php index 063ad09cb..97095822e 100644 --- a/views/default/object/image.php +++ b/views/default/object/image.php @@ -1,10 +1,7 @@ <?php /** - - * image object views - * @author Curverider Ltd - * @copyright Curverider Ltd 2008 - * @link http://elgg.com/ + * + * Tidypics image object views */ global $CONFIG; @@ -18,8 +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") { ?> @@ -40,73 +36,60 @@ if (get_context() == "search") { //if this is the search view echo elgg_view_listing($icon, $info); } -} -else { //tidypics image display + } else { + //tidypics image display - if (!$vars['full']) { //simple gallery view + if (!$vars['full']) { //simple gallery view ?> <div class="album_images"> <a href="<?php echo $file->getURL();?>"><img src="<?php echo $vars['url'];?>mod/tidypics/thumbnail.php?file_guid=<?php echo $file_guid;?>&size=small" border="0" alt="thumbnail"/></a> </div> <?php - } - else{ // individual full image view + } else { + // individual full image view - $album = get_entity($file->container_guid); + echo '<div class="contentWrapper">'; + + $album = get_entity($file->container_guid); - //compile back | next links - $current = array_search($file_guid, $_SESSION['image_sort']); + //compile back | next links + $current = array_search($file_guid, $_SESSION['image_sort']); - if(!$current){ // means we are no longer using the correct album array + 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(); + //rebuild the array -> + $count = get_entities("object","image", $album->guid, '', 999); + $_SESSION['image_sort'] = array(); - foreach($count as $image){ - array_push($_SESSION['image_sort'], $image->guid); - } + 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 = '<a href="' .$vars['url'] . 'pg/photos/view/' . $_SESSION['image_sort'][$current-1] . '"><<' . elgg_echo('image:back') . '</a> '; + if (!$current == 0) + $back = '<a href="' .$vars['url'] . 'pg/photos/view/' . $_SESSION['image_sort'][$current-1] . '"><<' . elgg_echo('image:back') . '</a> '; - if(array_key_exists(($current+1), $_SESSION['image_sort'])) - $next = ' <a href="' . $vars['url'] . 'pg/photos/view/' . $_SESSION['image_sort'][$current+1] . '">' . elgg_echo('image:next') . '>></a>'; + if (array_key_exists(($current+1), $_SESSION['image_sort'])) + $next = ' <a href="' . $vars['url'] . 'pg/photos/view/' . $_SESSION['image_sort'][$current+1] . '">' . elgg_echo('image:next') . '>></a>'; ?> - <div id="pages_breadcrumbs"> -<?php - if (is_null(page_owner_entity()->username) || empty(page_owner_entity()->username)) { //when no owner available, link to world photos -?> - <a href="<?php echo $vars['url'] . 'pg/photos/world'; ?>"><?php echo elgg_echo("albums"); ?></a> > -<?php - } else { -?> - <a href="<?php echo $vars['url'] . 'pg/photos/owned/' . page_owner_entity()->username; ?>"><?php echo sprintf(elgg_echo("album:user"), page_owner_entity()->name); ?></a> > -<?php - } -?> - <a href="<?php echo $album->getURL(); ?>"><?php echo $album->title; ?></a> > - <?php echo $current+1 . ' / ' . sizeof($_SESSION['image_sort']); ?> - </div> + <?php - echo '<div id="tidypics_title">' . $title . '</div>'; - echo '<div id="tidypics_desc">' . autop($desc) . '</div>'; - echo '<div id="image_full">'; - echo '<div id="image_nav">' . $back . $next . '</div>'; - if($next) echo '<a href="' . $vars['url'] . 'pg/photos/view/' . $_SESSION['image_sort'][$current+1] . '">'; - echo '<img src="' . $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $file_guid . '&size=large" border="0" alt="' . $title . '"/>'; - if($next) echo '</a>'; - echo '</div>'; + echo '<div id="tidypics_desc">' . autop($desc) . '</div>'; + echo '<div id="image_full">'; + echo '<div id="image_nav">' . $back . $next . '</div>'; + if ($next) echo '<a href="' . $vars['url'] . 'pg/photos/view/' . $_SESSION['image_sort'][$current+1] . '">'; + echo '<img src="' . $vars['url'] . 'mod/tidypics/thumbnail.php?file_guid=' . $file_guid . '&size=large" border="0" alt="' . $title . '"/>'; + if ($next) echo '</a>'; + echo '</div>'; ?> <div id="tidypics_controls"> <a target="_new" href="<?php echo $vars['url']; ?>action/tidypics/download?file_guid=<?php echo $file->getGUID(); ?>"><?php echo elgg_echo("image:download"); ?></a> <?php - if ($file->canEdit()) { // add edit controls + if ($file->canEdit()) { // add edit controls ?> <a href="<?php echo $vars['url']; ?>mod/tidypics/edit.php?file_guid=<?php echo $file->getGUID(); ?>"><?php echo elgg_echo('image:edit'); ?></a> <?php echo elgg_view('output/confirmlink',array( @@ -114,7 +97,7 @@ else { //tidypics image display 'text' => elgg_echo("image:delete"), 'confirm' => elgg_echo("image:delete:confirm"), )); - } + } ?> </div> @@ -123,8 +106,10 @@ else { //tidypics image display <?php echo elgg_echo('image:by');?> <b><a href="<?php echo $vars['url']; ?>pg/profile/<?php echo $owner->username; ?>"><?php echo $owner->name; ?></a></b> <?php echo $friendlytime; ?><br> </div> <?php - echo elgg_view_comments($file); - } + echo elgg_view_comments($file); + + echo '</div>'; + } -} + } // end of tidypics image display ?>
\ No newline at end of file |