/**
  * @see	\wcf\system\menu\user\profile\content\IUserProfileMenuContent::getContent()
  */
 public function getContent($userID)
 {
     if ($this->commentManager === null) {
         $this->objectTypeID = CommentHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.user.profileComment');
         $objectType = CommentHandler::getInstance()->getObjectType($this->objectTypeID);
         $this->commentManager = $objectType->getProcessor();
     }
     $commentList = CommentHandler::getInstance()->getCommentList($this->commentManager, $this->objectTypeID, $userID);
     // assign variables
     WCF::getTPL()->assign(array('commentCanAdd' => $this->commentManager->canAdd($userID), 'commentList' => $commentList, 'commentObjectTypeID' => $this->objectTypeID, 'userID' => $userID, 'lastCommentTime' => $commentList->getMinCommentTime(), 'likeData' => MODULE_LIKE ? $commentList->getLikeData() : array()));
     return WCF::getTPL()->fetch('userProfileCommentList');
 }
Ejemplo n.º 2
0
 /**
  * Validates the 'getGuestDialog' action.
  */
 public function validateGetGuestDialog()
 {
     if (WCF::getUser()->userID) {
         throw new PermissionDeniedException();
     }
     CommentHandler::enforceFloodControl();
     $this->readInteger('objectID', false, 'data');
     $objectType = $this->validateObjectType();
     // validate object id and permissions
     $this->commentProcessor = $objectType->getProcessor();
     if (!$this->commentProcessor->canAdd($this->parameters['data']['objectID'])) {
         throw new PermissionDeniedException();
     }
     // validate message already at this point to make sure that the
     // message is valid when submitting the dialog to avoid having to
     // go back to the message to fix it
     $this->validateMessage();
 }