Moved the can_posts_text value

This commit is contained in:
Pierre 2018-01-04 17:51:21 +01:00
parent debbdbc7ca
commit 814d840e38
2 changed files with 10 additions and 5 deletions

View File

@ -155,7 +155,6 @@ class friendsController{
"sent_request" => false, "sent_request" => false,
"received_request" => false, "received_request" => false,
"following" => false, "following" => false,
"can_post_texts" => false,
); );
//Check if the two personns are friend //Check if the two personns are friend
@ -180,10 +179,6 @@ class friendsController{
if(CS::get()->components->friends->is_following(userID, $friendID)) if(CS::get()->components->friends->is_following(userID, $friendID))
$response['following'] = true; $response['following'] = true;
//Check if the user can post text on his friend page
if(CS::get()->components->friends->can_post_text(userID, $friendID))
$response['can_post_texts'] = true;
} }
//Return the response //Return the response

View File

@ -139,9 +139,19 @@ class userController
//User friends won't be displayed //User friends won't be displayed
$userInfos["number_friends"] = 0; $userInfos["number_friends"] = 0;
//User can not post text on this page by default
$userInfos["can_post_texts"] = FALSE;
//Get some informations only is user is signed in //Get some informations only is user is signed in
if(user_signed_in()){ if(user_signed_in()){
$userInfos["user_like_page"] = CS::get()->components->likes->is_liking(userID, $userID, Likes::LIKE_USER); $userInfos["user_like_page"] = CS::get()->components->likes->is_liking(userID, $userID, Likes::LIKE_USER);
//Check if the user can post texts on this page
$userInfos["can_post_texts"] =
//If it is his page, yes by default
userID == $userID ? TRUE :
//Else check friendship status
CS::get()->components->friends->can_post_text(userID, $userID);
} }
//Return user informations //Return user informations