aboutsummaryrefslogtreecommitdiff
path: root/views/default
diff options
context:
space:
mode:
Diffstat (limited to 'views/default')
-rw-r--r--views/default/object/image.php3
-rw-r--r--views/default/tidypics/image_menu.php17
2 files changed, 16 insertions, 4 deletions
diff --git a/views/default/object/image.php b/views/default/object/image.php
index 93c79e174..e5ccd2276 100644
--- a/views/default/object/image.php
+++ b/views/default/object/image.php
@@ -212,7 +212,8 @@ if ($photo_tags) {
echo elgg_view('tidypics/image_menu', array('file_guid' => $file_guid,
'viewer' => $viewer,
'owner' => $owner,
- 'anytags' => $photo_tags != '',) );
+ 'anytags' => $photo_tags != '',
+ 'album' => $album, ) );
echo '</ul></div>';
// tagging code
diff --git a/views/default/tidypics/image_menu.php b/views/default/tidypics/image_menu.php
index b4597a99f..d6568360c 100644
--- a/views/default/tidypics/image_menu.php
+++ b/views/default/tidypics/image_menu.php
@@ -10,14 +10,25 @@
*
**************************************************************************/
- $file_guid = $vars['file_guid'];
+ $image_guid = $vars['file_guid'];
$viewer = $vars['viewer'];
$owner = $vars['owner'];
$anytags = $vars['anytags'];
+ $album = $vars['album'];
if (get_plugin_setting('tagging', 'tidypics') != "disabled") {
+
+ $can_tag = false;
+
+ $container = get_entity($album->container_guid);
+ if ($container instanceof ElggGroup) {
+ $can_tag = $viewer && $container->isMember($viewer);
+ } else {
+ $can_tag = $viewer && $viewer->guid == $owner->guid || user_is_friend($owner->guid, $viewer->guid);
+ }
+
// only owner and friends of owner can tag
- if ($viewer && $viewer->guid == $owner->guid || user_is_friend($owner->guid, $viewer->guid)) {
+ if ($can_tag) {
?>
<li id="start_tagging"><a id="tidypics_tag_control" href="javascript:void(0)" onclick="startTagging()"><?= elgg_echo('tidypics:tagthisphoto') ?></a></li>
<?php
@@ -33,7 +44,7 @@
if (get_plugin_setting('download_link', 'tidypics') != "disabled") {
?>
-<li id="download_image"><a href="<?php echo $vars['url']; ?>action/tidypics/download?file_guid=<?php echo $file_guid; ?>"><?php echo elgg_echo("image:download"); ?></a></li>
+<li id="download_image"><a href="<?php echo $vars['url']; ?>action/tidypics/download?file_guid=<?php echo $image_guid; ?>"><?php echo elgg_echo("image:download"); ?></a></li>
<?php
}
?> \ No newline at end of file