namespace wcf\system\user\notification\event;
+use wcf\data\moderation\queue\ViewableModerationQueue;
+use wcf\data\object\type\ObjectTypeCache;
+use wcf\system\moderation\queue\IModerationQueueHandler;
use wcf\system\request\LinkHandler;
use wcf\system\user\notification\object\ModerationQueueUserNotificationObject;
+use wcf\system\WCF;
/**
* Notification event for new reports in the moderation queue.
*/
final class ReportModerationQueueUserNotificationEvent extends AbstractUserNotificationEvent
{
+ private ViewableModerationQueue $viewableModerationQueue;
#[\Override]
public function getTitle(): string
{
[
'author' => $this->author,
'notification' => $this->notification,
- 'userNotificationObject' => $this->getUserNotificationObject(),
+ 'moderationQueue' => $this->getViewableModerationQueue(),
]
);
}
{
return \sha1($this->eventID . '-' . $this->getUserNotificationObject()->queueID);
}
+
+ #[\Override]
+ public function checkAccess()
+ {
+ $objectType = ObjectTypeCache::getInstance()->getObjectType($this->getUserNotificationObject()->objectTypeID);
+ $processor = $objectType->getProcessor();
+ \assert($processor instanceof IModerationQueueHandler);
+
+ return $processor->isAffectedUser(
+ $this->getUserNotificationObject()->getDecoratedObject(),
+ WCF::getUser()->userID
+ );
+ }
+
+ private function getViewableModerationQueue(): ViewableModerationQueue
+ {
+ if (!isset($this->viewableModerationQueue)) {
+ $this->viewableModerationQueue = new ViewableModerationQueue(
+ $this->getUserNotificationObject()->getDecoratedObject()
+ );
+ $objectType = ObjectTypeCache::getInstance()->getObjectType(
+ $this->getUserNotificationObject()->objectTypeID
+ );
+ $processor = $objectType->getProcessor();
+ \assert($processor instanceof IModerationQueueHandler);
+
+ $processor->populate([$this->viewableModerationQueue]);
+ }
+ return $this->viewableModerationQueue;
+ }
}
<item name="wcf.moderation.report.changeJustifiedStatus.markAsJustified"><![CDATA[Meldung als „Berechtigt“ markieren]]></item>
<item name="wcf.moderation.report.changeJustifiedStatus.confirmMessage"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Willst du{else}Wollen Sie{/if} den „Berechtigt“-Status dieser Meldung wirklich ändern?]]></item>
<item name="wcf.moderation.report.notification.title"><![CDATA[Neue Meldung]]></item>
+ <item name="wcf.moderation.report.notification.message"><![CDATA[{if $author->userID}<strong>{$author}</strong>{else}Ein Gast{/if} hat <strong>{$moderationQueue->getTitle()}</strong>({lang}wcf.moderation.type.{@$moderationQueue->getObjectTypeName()}{/lang}) gemeldet.]]></item>
</category>
<category name="wcf.notice">
<item name="wcf.notice.button.dismiss"><![CDATA[Hinweis dauerhaft ausblenden]]></item>
<item name="wcf.moderation.report.changeJustifiedStatus.markAsJustified"><![CDATA[Mark report as “Justified”]]></item>
<item name="wcf.moderation.report.changeJustifiedStatus.confirmMessage"><![CDATA[Do you really want to change the “Justified” status of this report?]]></item>
<item name="wcf.moderation.report.notification.title"><![CDATA[New report]]></item>
+ <item name="wcf.moderation.report.notification.message"><![CDATA[{if $author->userID}<strong>{$author}</strong>{else}A guest{/if} has reported <strong>{$moderationQueue->getTitle()}</strong>({lang}wcf.moderation.type.{@$moderationQueue->getObjectTypeName()}{/lang}).]]></item>
</category>
<category name="wcf.notice">
<item name="wcf.notice.button.dismiss"><![CDATA[Permanently dismiss this notice]]></item>