Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding features to remove user and create relationships, some UI twea…
…ks and JS/CSS changes and action chaining
- Loading branch information
Showing
23 changed files
with
7,585 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
namespace App\Action; | ||
|
||
class AddfriendAction extends Base | ||
{ | ||
|
||
public function run() | ||
{ | ||
|
||
$fb = $this->getFacebookClient(); | ||
|
||
try{ | ||
//Get Ids and tokens | ||
$uid_user = $this->getInspekt()->post->getInt('origin_user'); | ||
$token_user = $this->getInspekt()->post->getRaw('origin_user_token'); | ||
|
||
//Break down target info | ||
$data_friend = $this->getInspekt()->post->getRaw('target_user'); | ||
$data_friend = \explode(" ", $data_friend); | ||
$uid_friend = $data_friend[0]; | ||
$token_friend = $data_friend[1]; | ||
|
||
//Request 1 in name or origin user | ||
$fb->setAccessToken($token_user); | ||
$resA = $fb->api('/'.$uid_user.'/friends/'.$uid_friend); | ||
|
||
//Request 2 in name or target user | ||
$fb->setAccessToken($token_friend); | ||
$resB = $fb->api('/'.$uid_friend.'/friends/'.$uid_user); | ||
|
||
} catch(\Exception $e) { | ||
$this->redirectToError($e); | ||
return; | ||
} | ||
|
||
//Render Template | ||
$tpl = $this->getTplEngine()->loadTemplate('add_friend.html'); | ||
$tpl->display(array()); | ||
} | ||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace App\Action; | ||
|
||
class DeleteAction extends Base | ||
{ | ||
|
||
public function run() | ||
{ | ||
try { | ||
$fb = $this->getFacebookClient(); | ||
|
||
//Get Posted Data | ||
$uid = $this->getInspekt()->post->getInt('del_user'); | ||
$token = $this->getInspekt()->post->getRaw('del_user_token'); | ||
|
||
//API call | ||
$fb->setAccessToken($token); | ||
$res = $fb->api('/'.$uid, 'DELETE'); | ||
|
||
} catch (\Exception $e) { | ||
$this->redirectToError($e); | ||
return; | ||
} | ||
|
||
//Render List action | ||
$list = new ListAction(); | ||
$list->run(); | ||
|
||
return; | ||
|
||
} | ||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
|
||
fieldset{ | ||
border:solid 1px #DEDEDE; | ||
padding: 10px; | ||
} | ||
fieldset legend { | ||
font-weight:bold; padding: 0 10px; margin-left: 10px; | ||
} | ||
|
||
fieldset ul, fieldset li{ | ||
border:0; margin:0; padding:0; list-style:none; | ||
} | ||
|
||
fieldset li{ | ||
clear:both; | ||
list-style:none; | ||
padding:10px; | ||
} | ||
|
||
fieldset input[type=text]{ | ||
float:left; | ||
width: 250px; | ||
} | ||
|
||
fieldset input[type=file]{ | ||
float:left; | ||
width: 250px; | ||
} | ||
|
||
fieldset select{ | ||
float:left; | ||
width: 250px; | ||
} | ||
|
||
fieldset textarea{ | ||
float:left; | ||
width: 250px; | ||
} | ||
|
||
fieldset label{ | ||
width:140px; | ||
float:left; | ||
} | ||
|
||
fieldset button{ | ||
border:0; margin:0; padding:0; | ||
clear:both; | ||
width:125px; | ||
height:31px; | ||
background:#666666 url(img/button.png) no-repeat; | ||
text-align:center; | ||
line-height:31px; | ||
color:#FFFFFF; | ||
font-size:11px; | ||
font-weight:bold; | ||
} | ||
|
||
fieldset .note { | ||
float: right; | ||
color: #C3C3C3; | ||
font-size: 10px; | ||
} | ||
|
||
fieldset .instructions { | ||
padding: 10px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
function addFriend(origin_id, access_token) | ||
{ | ||
|
||
$('#origin_user').val(origin_id); | ||
$('#origin_user_token').val(access_token); | ||
$('#add_friend').overlay({ | ||
|
||
mask: { | ||
color: '#000', | ||
loadSpeed: 200, | ||
opacity: 0.7 | ||
}, | ||
closeOnClick: false, | ||
load: true | ||
}); | ||
|
||
} | ||
|
||
function deleteUser(uid, access_token) | ||
{ | ||
openLoading(); | ||
$('#del_user').val(uid); | ||
$('#del_user_token').val(access_token); | ||
$('#delete_user_form').submit(); | ||
|
||
} | ||
|
||
function openLoading() | ||
{ | ||
|
||
$("#loading").overlay({ | ||
|
||
mask: { | ||
color: '#000', | ||
loadSpeed: 200, | ||
opacity: 0.7 | ||
}, | ||
closeOnClick: false, | ||
load: true | ||
}); | ||
|
||
} | ||
|
||
function closeLoading() | ||
{ | ||
$("#loading").close(); | ||
} |
Oops, something went wrong.