2 namespace wcf\system\comment\manager
;
3 use wcf\data\user\UserProfile
;
4 use wcf\system\request\LinkHandler
;
8 * User profile comment manager implementation.
10 * @author Alexander Ebert
11 * @copyright 2001-2014 WoltLab GmbH
12 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
13 * @package com.woltlab.wcf
14 * @subpackage system.comment.manager
15 * @category Community Framework
17 class UserProfileCommentManager
extends AbstractCommentManager
{
19 * @see \wcf\system\comment\manager\AbstractCommentManager::$permissionAdd
21 protected $permissionAdd = 'user.profileComment.canAddComment';
24 * @see \wcf\system\comment\manager\AbstractCommentManager::$permissionCanModerate
26 protected $permissionCanModerate = 'mod.profileComment.canModerateComment';
29 * @see \wcf\system\comment\manager\AbstractCommentManager::$permissionDelete
31 protected $permissionDelete = 'user.profileComment.canDeleteComment';
34 * @see \wcf\system\comment\manager\AbstractCommentManager::$permissionEdit
36 protected $permissionEdit = 'user.profileComment.canEditComment';
39 * @see \wcf\system\comment\manager\AbstractCommentManager::$permissionModDelete
41 protected $permissionModDelete = 'mod.profileComment.canDeleteComment';
44 * @see \wcf\system\comment\manager\AbstractCommentManager::$permissionModEdit
46 protected $permissionModEdit = 'mod.profileComment.canEditComment';
49 * @see \wcf\system\comment\manager\ICommentManager::isAccessible()
51 public function isAccessible($objectID, $validateWritePermission = false) {
53 $userProfile = UserProfile
::getUserProfile($objectID);
54 if ($userProfile === null) {
59 if ($userProfile->isProtected()) {
63 // check target user settings
64 if ($validateWritePermission) {
65 if (!$userProfile->isAccessible('canWriteProfileComments') && $userProfile->userID
!= WCF
::getUser()->userID
) {
69 if ($userProfile->isIgnoredUser(WCF
::getUser()->userID
)) {
78 * @see \wcf\system\comment\manager\ICommentManager::getLink()
80 public function getLink($objectTypeID, $objectID) {
81 return LinkHandler
::getInstance()->getLink('User', array('id' => $objectID));
85 * @see \wcf\system\comment\manager\ICommentManager::getTitle()
87 public function getTitle($objectTypeID, $objectID, $isResponse = false) {
88 if ($isResponse) return WCF
::getLanguage()->get('wcf.user.profile.content.wall.commentResponse');
90 return WCF
::getLanguage()->getDynamicVariable('wcf.user.profile.content.wall.comment');
94 * @see \wcf\system\comment\manager\ICommentManager::updateCounter()
96 public function updateCounter($objectID, $value) { }