]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Add 'mod/friendrequest/' from commit 'bdd9179742dbd9101b61a5138e1a81b084747dd8'
authorSem <sembrestels@riseup.net>
Sat, 9 Nov 2013 15:14:29 +0000 (16:14 +0100)
committerSem <sembrestels@riseup.net>
Sat, 9 Nov 2013 15:14:29 +0000 (16:14 +0100)
git-subtree-dir: mod/friendrequest
git-subtree-mainline: e2a2fbdccaf0f48878903f448428cab5852d0870
git-subtree-split: bdd9179742dbd9101b61a5138e1a81b084747dd8

12 files changed:
1  2 
mod/friendrequest/actions/friendrequest/decline.php
mod/friendrequest/actions/friends/add.php
mod/friendrequest/actions/friends/remove.php
mod/friendrequest/languages/ca.php
mod/friendrequest/languages/en.php
mod/friendrequest/languages/es.php
mod/friendrequest/languages/gl.php
mod/friendrequest/languages/pt.php
mod/friendrequest/languages/sr.php
mod/friendrequest/manifest.xml
mod/friendrequest/start.php
mod/friendrequest/views/default/friendrequest/requests.php

index 0000000000000000000000000000000000000000,ca3f1c9e49a7fb3f22f0c0aa9f9d49fc137175d3..ca3f1c9e49a7fb3f22f0c0aa9f9d49fc137175d3
mode 000000,100644..100644
--- /dev/null
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..e6efe1db10fd5b45d28a2fd6067de4b1c3bc8766
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,53 @@@
++<?php
++/**
++ * Elgg add friend action
++ *
++ * @package Elgg.Core
++ * @subpackage Friends.Management
++ * @override actions/friends/add.php
++ */
++
++
++// Get the GUID of the user to friend
++$friend_guid = get_input('friend');
++$friend = get_entity($friend_guid);
++if (!$friend) {
++      register_error(elgg_echo('error:missing_data'));
++      forward(REFERER);
++}
++$user = elgg_get_logged_in_user_entity();
++
++$errors = false;
++
++if(check_entity_relationship($friend->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);
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..62bccb8912e1409d917dcddca546e1d59b71a1e6
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,36 @@@
++<?php
++/**
++ * Elgg remove friend action
++ *
++ * @package Elgg.Core
++ * @subpackage Friends.Management
++ * @override actions/friends/remove.php
++ */
++
++// Get the GUID of the user to friend
++$friend_guid = get_input('friend');
++$friend = get_entity($friend_guid);
++$errors = false;
++
++// Get the user
++try{
++      if ($friend instanceof ElggUser) {
++              elgg_get_logged_in_user_entity()->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);
index 0000000000000000000000000000000000000000,ab17319c1458339efe9b8257e17d04ba94df07a9..ab17319c1458339efe9b8257e17d04ba94df07a9
mode 000000,100644..100644
--- /dev/null
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..40bfbd36a9a2f1ea112bfdf59e76c86b7c9cce82
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,31 @@@
++<?php
++/**
++ * ElggFriendRequest English language file.
++ *
++ */
++
++$english = array(
++      'friendrequest' => '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);
index 0000000000000000000000000000000000000000,1677ef4fbf228851cc81422079f610015fecdbda..1677ef4fbf228851cc81422079f610015fecdbda
mode 000000,100644..100644
--- /dev/null
index 0000000000000000000000000000000000000000,9b8c1244040334fd36ffbafe41e83aea2ce196fa..9b8c1244040334fd36ffbafe41e83aea2ce196fa
mode 000000,100644..100644
--- /dev/null
index 0000000000000000000000000000000000000000,73010fd068c5a9e79105fb06ae8f97f1449916a5..73010fd068c5a9e79105fb06ae8f97f1449916a5
mode 000000,100644..100644
--- /dev/null
index 0000000000000000000000000000000000000000,d7d693a091652d702dd4d83c050c74bb2ec57913..d7d693a091652d702dd4d83c050c74bb2ec57913
mode 000000,100644..100644
--- /dev/null
index 0000000000000000000000000000000000000000,e5b4aad6a48c72d71510b33257de0dd36cb47763..e5b4aad6a48c72d71510b33257de0dd36cb47763
mode 000000,100644..100644
--- /dev/null
index 0000000000000000000000000000000000000000,2ea3c80f99da0148662ff79fd49e8010ae48119a..2ea3c80f99da0148662ff79fd49e8010ae48119a
mode 000000,100644..100644
--- /dev/null
index 0000000000000000000000000000000000000000,1680bdc4e64291757ba22513ac8767a4fe3eec3e..1680bdc4e64291757ba22513ac8767a4fe3eec3e
mode 000000,100644..100644
--- /dev/null