* @category Community Framework
*/
class UserProfileCommentResponseOwnerUserNotificationEvent extends AbstractUserNotificationEvent {
+ /**
+ * @see \wcf\system\user\notification\event\AbstractUserNotificationEvent::$stackable
+ */
+ protected $stackable = true;
+
/**
* @see \wcf\system\user\notification\event\IUserNotificationEvent::getTitle()
*/
public function getTitle() {
+ $count = count($this->getAuthors());
+ if ($count > 1) {
+ return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponseOwner.title.stacked', array(
+ 'count' => $count,
+ 'timesTriggered' => $this->timesTriggered
+ ));
+ }
+
return $this->getLanguage()->get('wcf.user.notification.commentResponseOwner.title');
}
));
}
+ $authors = array_values($this->getAuthors());
+ $count = count($authors);
+ if ($count > 1) {
+ return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponseOwner.message.stacked', array(
+ 'authors' => $authors,
+ 'count' => $count,
+ 'others' => max($count - 1, 0)
+ ));
+ }
+
return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponseOwner.message', array(
'author' => $this->author,
'commentAuthor' => $commentAuthor
public function getLink() {
return LinkHandler::getInstance()->getLink('User', array('object' => WCF::getUser()), '#wall');
}
+
+ /**
+ * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEventHash()
+ */
+ public function getEventHash() {
+ return sha1($this->eventID . '-' . $this->userNotificationObject->commentID);
+ }
}
* @category Community Framework
*/
class UserProfileCommentResponseUserNotificationEvent extends AbstractUserNotificationEvent {
+ /**
+ * @see \wcf\system\user\notification\event\AbstractUserNotificationEvent::$stackable
+ */
+ protected $stackable = true;
+
/**
* @see \wcf\system\user\notification\event\IUserNotificationEvent::getTitle()
*/
public function getTitle() {
+ $count = count($this->getAuthors());
+ if ($count > 1) {
+ return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponse.title.stacked', array(
+ 'count' => $count,
+ 'timesTriggered' => $this->timesTriggered
+ ));
+ }
+
return $this->getLanguage()->get('wcf.user.notification.commentResponse.title');
}
public function getMessage() {
// @todo: use cache or a single query to retrieve required data
$comment = new Comment($this->userNotificationObject->commentID);
+ $owner = new User($comment->objectID);
if ($comment->userID) {
$commentAuthor = new User($comment->userID);
}
));
}
+ $authors = array_values($this->getAuthors());
+ $count = count($authors);
+ if ($count > 1) {
+ return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponseOwner.message.stacked', array(
+ 'authors' => $authors,
+ 'count' => $count,
+ 'others' => max($count - 1, 0),
+ 'owner' => $owner
+ ));
+ }
+
return $this->getLanguage()->getDynamicVariable('wcf.user.notification.commentResponse.message', array(
'author' => $this->author,
- 'owner' => $user
+ 'owner' => $owner
));
}
* @category Community Framework
*/
class UserProfileCommentUserNotificationEvent extends AbstractUserNotificationEvent {
+ /**
+ * @see \wcf\system\user\notification\event\AbstractUserNotificationEvent::$stackable
+ */
+ protected $stackable = true;
+
/**
* @see \wcf\system\user\notification\event\IUserNotificationEvent::getTitle()
*/
public function getTitle() {
+ $count = count($this->getAuthors());
+ if ($count > 1) {
+ return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.title.stacked', array(
+ 'count' => $count,
+ 'timesTriggered' => $this->timesTriggered
+ ));
+ }
+
return $this->getLanguage()->get('wcf.user.notification.comment.title');
}
* @see \wcf\system\user\notification\event\IUserNotificationEvent::getMessage()
*/
public function getMessage() {
+ $authors = array_values($this->getAuthors());
+ $count = count($authors);
+
+ if ($count > 1) {
+ return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.message.stacked', array(
+ 'author' => $this->author,
+ 'authors' => $authors,
+ 'count' => $count,
+ 'others' => max($count - 1, 0)
+ ));
+ }
+
return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.message', array(
'author' => $this->author
));
public function getLink() {
return LinkHandler::getInstance()->getLink('User', array('object' => WCF::getUser()), '#wall');
}
+
+ /**
+ * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEventHash()
+ */
+ public function getEventHash() {
+ return sha1($this->eventID . '-' . $this->notification->userID);
+ }
}
<item name="wcf.user.notification.com.woltlab.wcf.user"><![CDATA[Benutzer-Profile]]></item>
<item name="wcf.user.notification.com.woltlab.wcf.user.follow.following"><![CDATA[Jemand folgt Ihnen]]></item>
<item name="wcf.user.notification.comment.title"><![CDATA[Neuer Kommentar (Pinnwand)]]></item>
+ <item name="wcf.user.notification.comment.title.stacked"><![CDATA[{#$timesTriggered} neue Kommentare (Pinnwand)]]></item>
<item name="wcf.user.notification.comment.message"><![CDATA[Hat einen Kommentar an Ihrer Pinnwand verfasst.]]></item>
+ <item name="wcf.user.notification.comment.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} und {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} und {#$count} weitere{/if} haben Kommentare an <a href="{link controller='User' object=$__wcf->getUser()}#wall{/link}">Ihrer Pinnwand</a> verfasst.]]></item>
<item name="wcf.user.notification.comment.mail"><![CDATA[{@$author->username} hat einen Kommentar an Ihrer Pinnwand verfasst:
{if $notificationType == 'instant'}
---------------------------------
---------------------------------
{/if}{link controller='User' object=$owner isEmail=true}{/link}#wall]]></item>
<item name="wcf.user.notification.commentResponse.title"><![CDATA[Neue Antwort (Pinnwand)]]></item>
+ <item name="wcf.user.notification.commentResponse.title.stacked"><![CDATA[{#$timesTriggered} neue Antworten (Pinnwand)]]></item>
<item name="wcf.user.notification.commentResponse.message"><![CDATA[Hat eine Antwort zu Ihrem Kommentar an der Pinnwand von {$owner->username} verfasst.]]></item>
+ <item name="wcf.user.notification.commentResponse.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} und {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} und {#$count} weitere{/if} haben auf Ihren Kommentare an der <a href="{link controller='User' object=$owner}#wall{/link}">Pinnwand von {$owner->username}</a> geantwortet.]]></item>
<item name="wcf.user.notification.commentResponse.mail"><![CDATA[{@$author->username} hat eine Antwort zu Ihrem Kommentar an der Pinnwand von "{@$owner->username}" verfasst:
{if $notificationType == 'instant'}
---------------------------------
---------------------------------
{/if}{link controller='User' object=$owner isEmail=true}{/link}#wall]]></item>
<item name="wcf.user.notification.commentResponseOwner.title"><![CDATA[Neue Antwort (Pinnwand)]]></item>
+ <item name="wcf.user.notification.commentResponseOwner.title.stacked"><![CDATA[{$#timesTriggered} neue Antworten (Pinnwand)]]></item>
<item name="wcf.user.notification.commentResponseOwner.message"><![CDATA[Hat eine Antwort zum Kommentar von {$commentAuthor->username} an Ihrer Pinnwand verfasst.]]></item>
+ <item name="wcf.user.notification.commentResponseOwner.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} und {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} und {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} und {#$count} weitere{/if} haben auf Kommentare an <a href="{link controller='User' object=$__wcf->getUser()}#wall{/link}">Ihrer Pinnwand</a> geantwortet.]]></item>
<item name="wcf.user.notification.commentResponseOwner.mail"><![CDATA[{@$author->username} hat eine Antwort zum Kommentar von "{@$commentAuthor->username}" an Ihrer Pinnwand verfasst:
{if $notificationType == 'instant'}
---------------------------------