/**
  * @see	\wcf\system\comment\manager\ICommentManager::canDeleteResponse()
  */
 public function canDeleteResponse(CommentResponse $response)
 {
     if ($response->getComment()->objectID == WCF::getUser()->userID && WCF::getSession()->getPermission('user.profileComment.canDeleteCommentInOwnProfile')) {
         return true;
     }
     return parent::canDeleteResponse($response);
 }
Пример #2
0
 /**
  * Edits a comment or response.
  * 
  * @return	array
  */
 public function edit()
 {
     $returnValues = array('action' => 'saved');
     if ($this->response === null) {
         $editor = new CommentEditor($this->comment);
         $editor->update(array('message' => $this->parameters['data']['message']));
         $comment = new Comment($this->comment->commentID);
         $returnValues['commentID'] = $this->comment->commentID;
         $returnValues['message'] = $comment->getFormattedMessage();
     } else {
         $editor = new CommentResponseEditor($this->response);
         $editor->update(array('message' => $this->parameters['data']['message']));
         $response = new CommentResponse($this->response->responseID);
         $returnValues['responseID'] = $this->response->responseID;
         $returnValues['message'] = $response->getFormattedMessage();
     }
     return $returnValues;
 }