<showHeader>1</showHeader>
<visibleEverywhere>0</visibleEverywhere>
</box>
+
+ <box identifier="com.woltlab.wcf.PageComments">
+ <name language="de">Kommentare</name>
+ <name language="en">Page Comments</name>
+ <boxType>system</boxType>
+ <controller>wcf\system\box\PageCommentsBoxController</controller>
+ <position>contentBottom</position>
+ <showHeader>1</showHeader>
+ <visibleEverywhere>0</visibleEverywhere>
+ </box>
</import>
</data>
<classname><![CDATA[wcf\system\user\notification\object\type\ModerationQueueCommentResponseUserNotificationObjectType]]></classname>
<category>com.woltlab.wcf.moderation</category>
</type>
+
+ <type>
+ <name>com.woltlab.wcf.page</name>
+ <definitionname>com.woltlab.wcf.comment.commentableContent</definitionname>
+ <classname><![CDATA[wcf\system\comment\manager\PageCommentManager]]></classname>
+ </type>
<!-- /comments -->
<!-- moderation -->
--- /dev/null
+{include file='__commentJavaScript' commentContainerID='pageCommentList'}
+
+<ul id="pageCommentList" class="commentList containerList" data-can-add="{if $commentCanAdd}true{else}false{/if}" data-object-id="{@$pageID}" data-object-type-id="{@$commentObjectTypeID}" data-comments="{@$commentList->countObjects()}" data-last-comment-time="{@$lastCommentTime}">
+ {include file='commentList'}
+</ul>
<parent>user.message</parent>
</category>
+ <category name="user.pageComment">
+ <parent>user</parent>
+ </category>
+
<category name="mod" />
<category name="mod.general">
<parent>mod</parent>
<category name="mod.profileComment">
<parent>mod.general</parent>
</category>
+ <category name="mod.pageComment">
+ <parent>mod.general</parent>
+ </category>
<category name="admin" />
</option>
<!-- /user.profile -->
+ <option name="user.pageComment.canAddComment">
+ <categoryname>user.pageComment</categoryname>
+ <optiontype>boolean</optiontype>
+ <defaultvalue>1</defaultvalue>
+ </option>
+ <option name="user.pageComment.canEditComment">
+ <categoryname>user.pageComment</categoryname>
+ <optiontype>boolean</optiontype>
+ <defaultvalue>1</defaultvalue>
+ <usersonly>1</usersonly>
+ </option>
+ <option name="user.pageComment.canDeleteComment">
+ <categoryname>user.pageComment</categoryname>
+ <optiontype>boolean</optiontype>
+ <defaultvalue>0</defaultvalue>
+ <admindefaultvalue>1</admindefaultvalue>
+ <usersonly>1</usersonly>
+ </option>
+
<option name="mod.general.canUseModeration">
<categoryname>mod.general</categoryname>
<optiontype>boolean</optiontype>
</option>
<!-- /mod.general -->
+ <option name="mod.pageComment.canEditComment">
+ <categoryname>mod.pageComment</categoryname>
+ <optiontype>boolean</optiontype>
+ <defaultvalue>0</defaultvalue>
+ <moddefaultvalue>1</moddefaultvalue>
+ <usersonly>1</usersonly>
+ </option>
+ <option name="mod.pageComment.canDeleteComment">
+ <categoryname>mod.pageComment</categoryname>
+ <optiontype>boolean</optiontype>
+ <defaultvalue>0</defaultvalue>
+ <moddefaultvalue>1</moddefaultvalue>
+ <usersonly>1</usersonly>
+ </option>
+ <option name="mod.pageComment.canModerateComment">
+ <categoryname>mod.pageComment</categoryname>
+ <optiontype>boolean</optiontype>
+ <defaultvalue>0</defaultvalue>
+ <moddefaultvalue>1</moddefaultvalue>
+ <usersonly>1</usersonly>
+ </option>
+
<!-- user.profileComment -->
<option name="user.profileComment.canAddComment">
<categoryname>user.profileComment</categoryname>
if ($this->pageType == 'system') {
$data['controllerCustomURL'] = (!empty($_POST['customURL'][0]) ? $_POST['customURL'][0] : '');
- $this->objectAction = new PageAction(array($this->page), 'update', array('data' => array_merge($this->additionalFields, $data)));
+ $this->objectAction = new PageAction(array($this->page), 'update', array('data' => array_merge($this->additionalFields, $data), 'boxToPage' => $this->getBoxToPage()));
$this->objectAction->executeAction();
}
else {
--- /dev/null
+<?php
+namespace wcf\system\box;
+use wcf\system\comment\CommentHandler;
+use wcf\system\request\RequestHandler;
+use wcf\system\WCF;
+
+/**
+ * Box for page comments.
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2016 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.box
+ * @category Community Framework
+ */
+class PageCommentsBoxController extends AbstractBoxController {
+ /**
+ * @inheritDoc
+ */
+ protected $supportedPositions = ['contentTop', 'contentBottom'];
+
+ /**
+ * @inheritDoc
+ */
+ public function getTitle() {
+ return WCF::getLanguage()->get('wcf.page.comments');
+ }
+
+ /**
+ * @inheritDoc
+ */
+ protected function loadContent() {
+ $commentObjectTypeID = CommentHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.page');
+ $commentManager = CommentHandler::getInstance()->getObjectType($commentObjectTypeID)->getProcessor();
+ $commentList = CommentHandler::getInstance()->getCommentList($commentManager, $commentObjectTypeID, RequestHandler::getInstance()->getActiveRequest()->getPageID());
+
+ if (WCF::getSession()->getPermission('user.pageComment.canAddComment') || count($commentList)) {
+ WCF::getTPL()->assign([
+ 'pageID' => RequestHandler::getInstance()->getActiveRequest()->getPageID(),
+ 'commentCanAdd' => WCF::getSession()->getPermission('user.pageComment.canAddComment'),
+ 'commentList' => $commentList,
+ 'commentObjectTypeID' => $commentObjectTypeID,
+ 'lastCommentTime' => $commentList->getMinCommentTime()
+ ]);
+
+ $this->content = WCF::getTPL()->fetch('boxPageComments');
+ }
+ }
+}
--- /dev/null
+<?php
+namespace wcf\system\comment\manager;
+use wcf\system\request\LinkHandler;
+
+/**
+ * Page comment manager implementation.
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2016 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package com.woltlab.wcf
+ * @subpackage system.comment.manager
+ * @category Community Framework
+ */
+class PageCommentManager extends AbstractCommentManager {
+ /**
+ * @inheritDoc
+ */
+ protected $permissionAdd = 'user.pageComment.canAddComment';
+
+ /**
+ * @inheritDoc
+ */
+ protected $permissionDelete = 'user.pageComment.canDeleteComment';
+
+ /**
+ * @inheritDoc
+ */
+ protected $permissionEdit = 'user.pageComment.canEditComment';
+
+ /**
+ * @inheritDoc
+ */
+ protected $permissionModDelete = 'mod.pageComment.canDeleteComment';
+
+ /**
+ * @inheritDoc
+ */
+ protected $permissionModEdit = 'mod.pageComment.canEditComment';
+
+ /**
+ * @inheritDoc
+ */
+ public function isAccessible($objectID, $validateWritePermission = false) {
+ // @todo
+ return true;
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function getLink($objectTypeID, $objectID) {
+ return LinkHandler::getInstance()->getCmsLink($objectID);
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function getTitle($objectTypeID, $objectID, $isResponse = false) {
+ return '';
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function updateCounter($objectID, $value) {}
+
+ /**
+ * @inheritDoc
+ */
+ public function supportsLike() {
+ return false;
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function supportsReport() {
+ return false;
+ }
+}
<item name="wcf.page.onlineLocation.com.woltlab.wcf.AvatarEdit"><![CDATA[Avatar-Verwaltung]]></item>
<item name="wcf.page.onlineLocation.com.woltlab.wcf.Settings"><![CDATA[Einstellungen]]></item>
<item name="wcf.page.onlineLocation.com.woltlab.wcf.SignatureEdit"><![CDATA[Signatur-Verwaltung]]></item>
+ <item name="wcf.page.comments"><![CDATA[Kommentare]]></item>
</category>
<category name="wcf.paidSubscription">
<item name="wcf.page.onlineLocation.com.woltlab.wcf.AvatarEdit"><![CDATA[Avatar Management]]></item>
<item name="wcf.page.onlineLocation.com.woltlab.wcf.Settings"><![CDATA[Settings]]></item>
<item name="wcf.page.onlineLocation.com.woltlab.wcf.SignatureEdit"><![CDATA[Signature Management]]></item>
+ <item name="wcf.page.comments"><![CDATA[Comments]]></item>
</category>
<category name="wcf.paidSubscription">