]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
added tagging notifications - uses user's default notification setting like comments
authorCash Costello <cash.costello@gmail.com>
Fri, 21 Aug 2009 12:09:41 +0000 (12:09 +0000)
committerCash Costello <cash.costello@gmail.com>
Fri, 21 Aug 2009 12:09:41 +0000 (12:09 +0000)
actions/addtag.php
languages/en.php

index 3f623fc86cf36b8beef9528a85585864c0ef75f7..2c258db84c213af52cad35651b3989bcf91d0158 100644 (file)
@@ -69,6 +69,7 @@
 \r
        $access_id = $image->getAccessID();\r
        $owner_id = get_loggedin_userid();\r
+       $tagger = get_loggedin_user();\r
 \r
        //Save annotation\r
        if ($image->annotate('phototag', serialize($tag), $access_id, $owner_id)) {\r
                                \r
                                // also add this to the river - subject is image, object is the tagged user\r
                                if (function_exists('add_to_river'))\r
-                                       add_to_river('river/object/image/tag', 'tag', $image_guid, $user_id, $access_id); \r
+                                       add_to_river('river/object/image/tag', 'tag', $image_guid, $user_id, $access_id);\r
+                               \r
+                               // notify user of tagging as long as not self\r
+                               if ($owner_id != $user_id)\r
+                                       notify_user($user_id, $owner_id, elgg_echo('tidypics:tag:subject'), \r
+                                               sprintf(\r
+                                                                       elgg_echo('tidypics:tag:body'),\r
+                                                                       $image->title,\r
+                                                                       $tagger->name,\r
+                                                                       $image->getURL()\r
+                                                               )\r
+                                       );\r
                        }\r
                }\r
        \r
index c6d9bd61b2d1d80721d6f7d2417a1d1bd58fd68c..98cf9db53b2243e0543fff5e563040b16e884f40 100644 (file)
                        'tidypics:phototagging:success' => 'Photo tag was successfully added',\r
                        'tidypics:phototagging:error' => 'Unexpected error occurred during tagging',\r
                        'tidypics:deletetag:success' => 'Selected tags were successfully deleted',\r
+                       \r
+                       'tidypics:tag:subject' => "You have been tagged in a photo",\r
+                       'tidypics:tag:body' => "You have been tagged in the photo %s by %s.                     \r
+                       \r
+The photo can be viewed here: %s",\r
 \r
 \r
                //rss\r