aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--viewimage.php53
-rw-r--r--views/default/object/album.php17
-rw-r--r--views/default/object/image.php13
-rw-r--r--views/default/tidypics/css.php29
-rw-r--r--views/default/tidypics/groupprofile_albums.php10
5 files changed, 62 insertions, 60 deletions
diff --git a/viewimage.php b/viewimage.php
index 85e8d8215..8231bef3d 100644
--- a/viewimage.php
+++ b/viewimage.php
@@ -9,34 +9,35 @@
// Load Elgg engine
include_once(dirname(dirname(dirname(__FILE__))) . "/engine/start.php");
- // Get the GUID of the entity we want to view
- $guid = (int) get_input('guid');
-
- $context = get_input('context');
- if ($context) set_context($context);
-
- // Get the entity, if possible
- if ($entity = get_entity($guid)) {
-
- //set "real" container - image container is the album , group/user is the album container
- $top_container = get_entity($entity->container_guid)->container_guid;
-
- if ($top_container) {
- set_page_owner($top_container);
- } else {
- set_page_owner($entity->owner_guid);
- }
-
- $title = $entity->title;
- $area2 = elgg_view_title($title);
- $area2 .= elgg_view_entity($entity, true);
-
- } else {
- $body = elgg_echo('notfound');
+ // get the album entity
+ $photo_guid = (int) get_input('guid');
+ $photo = get_entity($photo_guid);
+
+ // panic if we can't get it
+ if (!$photo) forward();
+
+ // container of photo should always be set, but just in case
+ set_page_owner($photo->owner_guid);
+ $album = get_entity($photo->container_guid);
+ if ($album) {
+ $owner_guid = $album->container_guid;
+ if ($owner_guid)
+ set_page_owner($owner_guid);
}
-
+
+ add_submenu_item( elgg_echo('image:edit'),
+ $CONFIG->wwwroot . 'pg/photos/edit/' . $photo_guid,
+ 'photos');
+ add_submenu_item( elgg_echo('image:delete'),
+ $CONFIG->wwwroot . 'pg/photos/delete/' . $photo_guid,
+ 'photos',
+ true);
+
+ $title = $photo->title;
+ $area2 = elgg_view_title($title);
+ $area2 .= elgg_view_entity($photo, true);
+
$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/album.php b/views/default/object/album.php
index a1b238812..a94f12590 100644
--- a/views/default/object/album.php
+++ b/views/default/object/album.php
@@ -63,23 +63,6 @@
<?php
echo '<div id="tidypics_desc">'.autop($desc).'</div>';
- if ($file->canEdit()) { // add controls
-
-?>
- <div id="tidypics_controls">
- <a href="<?php echo $vars['url'] . "pg/photos/upload/" . $file_guid ;?>"><?php echo elgg_echo('album:addpix');?></a>
- <a href="<?php echo $vars['url']; ?>mod/tidypics/edit.php?file_guid=<?php echo $file->getGUID(); ?>"><?php echo elgg_echo('album:edit'); ?></a>&nbsp;
-
- <?php echo elgg_view('output/confirmlink',array(
- 'href' => $vars['url'] . "action/tidypics/delete?file=" . $file->getGUID(),
- 'text' => elgg_echo("album:delete"),
- 'confirm' => elgg_echo("album:delete:confirm"),
- ));
- ?>
- </div>
-<?php
- }
-
// display the simple image views. Uses: via 'object/image.php'
$count = get_entities("object","image", $file_guid, '', 999);
diff --git a/views/default/object/image.php b/views/default/object/image.php
index 97095822e..79939bfbb 100644
--- a/views/default/object/image.php
+++ b/views/default/object/image.php
@@ -87,18 +87,7 @@
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>&nbsp;
-<?php
- 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>&nbsp;
- <?php echo elgg_view('output/confirmlink',array(
- 'href' => $vars['url'] . "action/tidypics/delete?file=" . $file->getGUID(),
- 'text' => elgg_echo("image:delete"),
- 'confirm' => elgg_echo("image:delete:confirm"),
- ));
- }
- ?>
+<div class="tidypics_download"><p><a href="<?php echo $vars['url']; ?>action/tidypics/download?file_guid=<?php echo $file_guid; ?>"><?php echo elgg_echo("image:download"); ?></a></p></div>
</div>
<div id="tidypics_info">
diff --git a/views/default/tidypics/css.php b/views/default/tidypics/css.php
index c1957d5d9..3c935e8c5 100644
--- a/views/default/tidypics/css.php
+++ b/views/default/tidypics/css.php
@@ -27,6 +27,35 @@
margin:10px;
}
+#group_albums_widget {
+-webkit-border-radius: 8px;
+-moz-border-radius: 8px;
+background:white none repeat scroll 0 0;
+margin:0 0 20px;
+padding:0 0 5px;
+}
+
+.tidypics_download a {
+ font: 12px/100% Arial, Helvetica, sans-serif;
+ font-weight: bold;
+ color: white;
+ background:#4690d6;
+ border:none;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ width: auto;
+ height: 25px;
+ padding: 3px 6px 3px 6px;
+ margin:10px 0 10px 0;
+ cursor: pointer;
+}
+.tidypics_download a:hover {
+ background: black;
+ color:white;
+ text-decoration: none;
+}
+
+
/* independent album view only */
.album_images{
diff --git a/views/default/tidypics/groupprofile_albums.php b/views/default/tidypics/groupprofile_albums.php
index ff63a38d1..d975f5f99 100644
--- a/views/default/tidypics/groupprofile_albums.php
+++ b/views/default/tidypics/groupprofile_albums.php
@@ -11,7 +11,7 @@ if ($vars['entity']->photos_enable != 'no') {
$owner = page_owner_entity();
$owner_albums = get_entities("object", "album", page_owner(), "", $number, 0, false);
- echo '<div id="group_albums_widget">';
+ echo '<div id="group_albums_widget">';
echo '<h2>' . elgg_echo('albums') . '</h2>';
if ($owner_albums) {
@@ -50,11 +50,11 @@ if ($vars['entity']->photos_enable != 'no') {
echo "</div>";
} else {
- echo '<div id="no_album_found">';
- echo '<p class="pages_add_title">'.elgg_echo("album:none").'</p>';
+ //echo '<div id="no_album_found">';
+ //echo '<p class="pages_add_title">'.elgg_echo("album:none").'</p>';
if ($owner && ($owner->canWriteToContainer($_SESSION['user']))){
- echo '<a class="add_topic_button" href='.$CONFIG->url .'pg/photos/new/'.$owner->username.'>'.elgg_echo("album:add").'</a>';
- echo '</div>';
+ //echo '<a class="add_topic_button" href='.$CONFIG->url .'pg/photos/new/'.$owner->username.'>'.elgg_echo("album:add").'</a>';
+ //echo '</div>';
}
}