diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/default/object/image.php | 8 | ||||
-rw-r--r-- | views/default/tidypics/image_menu.php | 8 | ||||
-rw-r--r-- | views/default/tidypics/tagging.php | 3 |
3 files changed, 15 insertions, 4 deletions
diff --git a/views/default/object/image.php b/views/default/object/image.php index 546cd711e..b65dc858e 100644 --- a/views/default/object/image.php +++ b/views/default/object/image.php @@ -172,14 +172,18 @@ if ($photo_tags) { <?php // image menu (start tagging, download, etc.) echo '<div id="tidypics_controls"><ul>'; - echo elgg_view('tidypics/image_menu', array('file_guid' => $file_guid,) ); + echo elgg_view('tidypics/image_menu', array('file_guid' => $file_guid, + 'viewer' => $viewer, + 'owner' => $owner,) ); echo '</ul></div>'; // tagging code echo elgg_view('tidypics/tagging', array( 'photo_tags' => $photo_tags, 'links' => $photo_tag_links, 'photo_tags_json' => $photo_tags_json, - 'file_guid' => $file_guid, ) ); + 'file_guid' => $file_guid, + 'viewer' => $viewer, + 'owner' => $owner, ) ); ?> <div id="tidypics_breadcrumbs"> diff --git a/views/default/tidypics/image_menu.php b/views/default/tidypics/image_menu.php index 269fcce8f..dcec9b35a 100644 --- a/views/default/tidypics/image_menu.php +++ b/views/default/tidypics/image_menu.php @@ -11,9 +11,15 @@ **************************************************************************/
$file_guid = $vars['file_guid'];
+ $viewer = $vars['viewer'];
+ $owner = $vars['owner'];
+
+ // only owner and friends of owner can tag
+ if ($viewer && $viewer->guid == $owner->guid || user_is_friend($owner->guid, $viewer->guid)) {
?>
<li id="start_tagging"><a id="tag_control" href="javascript:void(0)" onclick="startTagging()"><?= elgg_echo('tidypics:tagthisphoto') ?></a></li>
-<?php
+<?php
+ }
if (get_plugin_setting('download_link', 'tidypics') != "no") {
?>
<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>
diff --git a/views/default/tidypics/tagging.php b/views/default/tidypics/tagging.php index a97285016..8ba58be4f 100644 --- a/views/default/tidypics/tagging.php +++ b/views/default/tidypics/tagging.php @@ -3,6 +3,8 @@ $links = $vars['links'];
$photo_tags_json = $vars['photo_tags_json'];
$file_guid = $vars['file_guid'];
+ $viewer = $vars['viewer'];
+ $owner = $vars['owner'];
if ($photo_tags) {
?>
@@ -26,7 +28,6 @@ <div id="tag_menu">
<?php
- $viewer = get_loggedin_user();
if($viewer) {
$friends = get_entities_from_relationship('friend', $viewer->getGUID(), false, 'user', '', 0);
|