2 namespace wcf\system\user\notification\event;
3 use wcf\data\user\User;
4 use wcf\system\request\LinkHandler;
7 * User notification event for profile commments.
9 * @author Alexander Ebert
10 * @copyright 2001-2015 WoltLab GmbH
11 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
12 * @package com.woltlab.wcf
13 * @subpackage system.user.notification.event
14 * @category Community Framework
16 class UserProfileCommentUserNotificationEvent extends AbstractUserNotificationEvent {
18 * @see \wcf\system\user\notification\event\AbstractUserNotificationEvent::$stackable
20 protected $stackable = true;
23 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getTitle()
25 public function getTitle() {
26 $count = count($this->getAuthors());
28 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.title.stacked', array(
30 'timesTriggered' => $this->notification->timesTriggered
34 return $this->getLanguage()->get('wcf.user.notification.comment.title');
38 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getMessage()
40 public function getMessage() {
41 $authors = $this->getAuthors();
42 if (count($authors) > 1) {
43 if (isset($authors[0])) {
46 $count = count($authors);
48 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.message.stacked', array(
49 'author' => $this->author,
50 'authors' => array_values($authors),
52 'others' => $count - 1,
53 'guestTimesTriggered' => $this->notification->guestTimesTriggered
57 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.message', array(
58 'author' => $this->author
63 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEmailMessage()
65 public function getEmailMessage($notificationType = 'instant') {
66 $user = new User($this->userNotificationObject->objectID);
68 $authors = $this->getAuthors();
69 if (count($authors) > 1) {
70 if (isset($authors[0])) {
73 $count = count($authors);
75 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.mail.stacked', array(
76 'author' => $this->author,
77 'authors' => array_values($authors),
79 'others' => $count - 1,
81 'notificationType' => $notificationType,
82 'guestTimesTriggered' => $this->notification->guestTimesTriggered
86 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.mail', array(
87 'comment' => $this->userNotificationObject,
88 'author' => $this->author,
90 'notificationType' => $notificationType
95 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getLink()
97 public function getLink() {
98 return LinkHandler::getInstance()->getLink('User', array('id' => $this->userNotificationObject->objectID), '#wall');
102 * @see \wcf\system\user\notification\event\IUserNotificationEvent::getEventHash()
104 public function getEventHash() {
105 return sha1($this->eventID . '-' . $this->notification->userID);