From: Sem Date: Sat, 9 Nov 2013 15:14:29 +0000 (+0100) Subject: Add 'mod/friendrequest/' from commit 'bdd9179742dbd9101b61a5138e1a81b084747dd8' X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=ba0d506ade08ae46ba665474a8b9c81e838f2eee;p=lorea%2Felgg.git Add 'mod/friendrequest/' from commit 'bdd9179742dbd9101b61a5138e1a81b084747dd8' git-subtree-dir: mod/friendrequest git-subtree-mainline: e2a2fbdccaf0f48878903f448428cab5852d0870 git-subtree-split: bdd9179742dbd9101b61a5138e1a81b084747dd8 --- ba0d506ade08ae46ba665474a8b9c81e838f2eee diff --cc mod/friendrequest/actions/friendrequest/decline.php index 000000000,ca3f1c9e4..ca3f1c9e4 mode 000000,100644..100644 --- a/mod/friendrequest/actions/friendrequest/decline.php +++ b/mod/friendrequest/actions/friendrequest/decline.php diff --cc mod/friendrequest/actions/friends/add.php index 000000000,000000000..e6efe1db1 new file mode 100644 --- /dev/null +++ b/mod/friendrequest/actions/friends/add.php @@@ -1,0 -1,0 +1,53 @@@ ++guid, "friendrequest", $user->guid) ++ || check_entity_relationship($friend->guid, "friend", $user->guid)) { ++ ++ try { ++ if (!$user->addFriend($friend_guid)) { ++ $errors = true; ++ } ++ ++ $ia = elgg_set_ignore_access(true); ++ $friend->addFriend($user->guid); ++ elgg_set_ignore_access($ia); ++ ++ remove_entity_relationship($friend->guid, "friendrequest", $user->guid); ++ ++ } catch (Exception $e) { ++ register_error(elgg_echo("friends:add:failure", array($friend->name))); ++ $errors = true; ++ } ++ if (!$errors) { ++ // add to river ++ add_to_river('river/relationship/friend/create', 'friend', $user->guid, $friend->guid); ++ add_to_river('river/relationship/friend/create', 'friend', $friend->guid, $user->guid); ++ system_message(elgg_echo("friends:add:successful", array($friend->name))); ++ } ++} elseif(add_entity_relationship($user->guid, "friendrequest", $friend->guid)) { ++ system_message(elgg_echo("friendrequest:add:successful", array($friend->name))); ++} else { ++ register_error(elgg_echo("friendrequest:add:exists", array($friend->name))); ++} ++ ++// Forward back to the page you friended the user on ++forward(REFERER); diff --cc mod/friendrequest/actions/friends/remove.php index 000000000,000000000..62bccb891 new file mode 100644 --- /dev/null +++ b/mod/friendrequest/actions/friends/remove.php @@@ -1,0 -1,0 +1,36 @@@ ++removeFriend($friend_guid); ++ $ia = elgg_set_ignore_access(true); ++ $friend->removeFriend(elgg_get_logged_in_user_guid()); ++ elgg_set_ignore_access($ia); ++ } else { ++ register_error(elgg_echo("friends:remove:failure", array($friend->name))); ++ $errors = true; ++ } ++} catch (Exception $e) { ++ register_error(elgg_echo("friends:remove:failure", array($friend->name))); ++ $errors = true; ++} ++ ++if (!$errors) { ++ system_message(elgg_echo("friends:remove:successful", array($friend->name))); ++} ++ ++// Forward back to the page you made the friend on ++forward(REFERER); diff --cc mod/friendrequest/languages/ca.php index 000000000,ab17319c1..ab17319c1 mode 000000,100644..100644 --- a/mod/friendrequest/languages/ca.php +++ b/mod/friendrequest/languages/ca.php diff --cc mod/friendrequest/languages/en.php index 000000000,000000000..40bfbd36a new file mode 100644 --- /dev/null +++ b/mod/friendrequest/languages/en.php @@@ -1,0 -1,0 +1,31 @@@ ++ 'Friend Requests', ++ ++ 'friendrequest:add:successful' => 'You sent a friend request to %s. She has to accept it. Give she time.', ++ 'friendrequest:add:failure' => 'Oops! There was a problem while trying to send the request. Try it again.', ++ 'friendrequest:add:exists' => 'You already sent a friend request to %s, don\'t be so intense.', ++ ++ 'friendrequest:decline:success' => 'You just declined %s friend request', ++ 'friendrequest:decline:fail' => 'For any reason this friend request cannot be deleted', ++ ++ 'friendrequest:remove:check' => 'Are you sure you want to decline the friend request?', ++ 'friendrequest:none' => 'No pending friend requests.', ++ ++ 'friendrequest:new:subject' => '%s want to be your friend', ++ 'friendrequest:new:body' => '%s want to be your friend. She is waiting that you aprovate her petition. Do not her wait! ++ ++You can see your pending friend requests following this link (remember you have to be logged in to see it): ++ ++ %s ++ ++(Do not try to reply this mail, because is a machine who is sending it)', ++ ++); ++ ++add_translation('en', $english); diff --cc mod/friendrequest/languages/es.php index 000000000,1677ef4fb..1677ef4fb mode 000000,100644..100644 --- a/mod/friendrequest/languages/es.php +++ b/mod/friendrequest/languages/es.php diff --cc mod/friendrequest/languages/gl.php index 000000000,9b8c12440..9b8c12440 mode 000000,100644..100644 --- a/mod/friendrequest/languages/gl.php +++ b/mod/friendrequest/languages/gl.php diff --cc mod/friendrequest/languages/pt.php index 000000000,73010fd06..73010fd06 mode 000000,100644..100644 --- a/mod/friendrequest/languages/pt.php +++ b/mod/friendrequest/languages/pt.php diff --cc mod/friendrequest/languages/sr.php index 000000000,d7d693a09..d7d693a09 mode 000000,100644..100644 --- a/mod/friendrequest/languages/sr.php +++ b/mod/friendrequest/languages/sr.php diff --cc mod/friendrequest/manifest.xml index 000000000,e5b4aad6a..e5b4aad6a mode 000000,100644..100644 --- a/mod/friendrequest/manifest.xml +++ b/mod/friendrequest/manifest.xml diff --cc mod/friendrequest/start.php index 000000000,2ea3c80f9..2ea3c80f9 mode 000000,100644..100644 --- a/mod/friendrequest/start.php +++ b/mod/friendrequest/start.php diff --cc mod/friendrequest/views/default/friendrequest/requests.php index 000000000,1680bdc4e..1680bdc4e mode 000000,100644..100644 --- a/mod/friendrequest/views/default/friendrequest/requests.php +++ b/mod/friendrequest/views/default/friendrequest/requests.php