Exemple #1
0
 public function preparePost(array $post, array $team, array $category, $viewingUser = null)
 {
     $this->standardizeViewingUserReference($viewingUser);
     if (!isset($post['canInlineMod'])) {
         $this->addInlineModOptionToPost($post, $team, $category, $viewingUser);
     }
     $post['canReport'] = $this->getModelFromCache('XenForo_Model_User')->canReportContent();
     $post['canDelete'] = $this->canDeletePost($post, $team, $category, $null, $viewingUser);
     $post['canApprove'] = $this->canApproveUnapprove($post, $team, $category, $null, $viewingUser);
     $post['canEdit'] = $this->canEditPost($post, $team, $category, $null, $viewingUser);
     $post['canComment'] = $this->canCommentOnPost($post, $team, $category, $null, $viewingUser);
     $post['canLike'] = $this->canLikePost($post, $team, $category, $null, $viewingUser);
     $post['canSticky'] = $this->canStickyOrUnstickyPost($post, $team, $category, $null, $viewingUser);
     if ($post['likes']) {
         $post['likeUsers'] = unserialize($post['like_users']);
     }
     $post = $this->getModelFromCache('Nobita_Teams_Model_Banning')->prepareContent($post, $team, $category, $null, $viewingUser);
     $post['isModerated'] = $this->isModerated($post, $team);
     if (!empty($post['delete_date'])) {
         $post['deleteInfo'] = array('user_id' => $post['delete_user_id'], 'username' => $post['delete_username'], 'date' => $post['delete_date'], 'reason' => $post['delete_reason']);
     }
     if ($post['system_posting']) {
         $post['message'] = Nobita_Teams_Setup::helperSystemPost($post);
     }
     Nobita_Teams_Banning::generateBanningUniqueId($post, 'post');
     return $post;
 }