Some improvements and added missing phrases
authorAlexander Ebert <ebert@woltlab.com>
Tue, 1 Jul 2014 23:57:14 +0000 (01:57 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 1 Jul 2014 23:57:14 +0000 (01:57 +0200)
wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentLikeUserNotificationEvent.class.php
wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseLikeUserNotificationEvent.class.php
wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseOwnerUserNotificationEvent.class.php
wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentResponseUserNotificationEvent.class.php
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index f72869945899bb880fd6d3ba4a857f4a36bc3925..04e1c6ce66338d3d123e1e1ab7b0c41c27541662 100644 (file)
@@ -1,6 +1,5 @@
 <?php
 namespace wcf\system\user\notification\event;
-use wcf\data\user\User;
 use wcf\system\comment\CommentDataHandler;
 use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
index a33c12a5f7a0828d0458250c6b67465daf1ce096..42087966c78fef494982c3f4c328943e143c79b8 100644 (file)
@@ -1,8 +1,7 @@
 <?php
 namespace wcf\system\user\notification\event;
-use wcf\data\user\User;
+use wcf\system\comment\CommentDataHandler;
 use wcf\system\request\LinkHandler;
-use wcf\system\user\notification\event\AbstractUserNotificationEvent;
 use wcf\system\WCF;
 
 /**
@@ -15,12 +14,20 @@ use wcf\system\WCF;
  * @subpackage system.user.notification.event
  * @category   Community Framework
  */
-class UserProfileCommentResponseLikeUserNotificationEvent extends AbstractUserNotificationEvent {
+class UserProfileCommentResponseLikeUserNotificationEvent extends AbstractSharedUserNotificationEvent {
        /**
         * @see \wcf\system\user\notification\event\AbstractUserNotificationEvent::$stackable
         */
        protected $stackable = true;
        
+       /**
+        * @see \wcf\system\user\notification\event\AbstractUserNotificationEvent::prepare()
+        */
+       protected function prepare() {
+               CommentDataHandler::getInstance()->cacheUserID($this->additionalData['objectID']);
+               CommentDataHandler::getInstance()->cacheUserID($this->additionalData['commentUserID']);
+       }
+       
        /**
         * @see \wcf\system\user\notification\event\IUserNotificationEvent::getTitle()
         */
@@ -44,10 +51,10 @@ class UserProfileCommentResponseLikeUserNotificationEvent extends AbstractUserNo
                $count = count($authors);
                $commentUser = $owner = null;
                if ($this->additionalData['objectID'] != WCF::getUser()->userID) {
-                       $owner = new User($this->additionalData['objectID']);
+                       $owner = CommentDataHandler::getInstance()->getUser($this->additionalData['objectID']);
                }
                if ($this->additionalData['commentUserID'] != WCF::getUser()->userID) {
-                       $commentUser = new User($this->additionalData['commentUserID']);
+                       $commentUser = CommentDataHandler::getInstance()->getUser($this->additionalData['commentUserID']);
                }
                
                if ($count > 1) {
index bc1263cdfe86e21fb58f83a45c393a2ef828675b..eb24bad634b0b48a63bee6b8ca98240fa893e9ae 100644 (file)
@@ -27,6 +27,7 @@ class UserProfileCommentResponseOwnerUserNotificationEvent extends AbstractShare
         */
        protected function prepare() {
                CommentDataHandler::getInstance()->cacheCommentID($this->userNotificationObject->commentID);
+               CommentDataHandler::getInstance()->cacheUserID($this->additionalData['userID']);
        }
        
        /**
@@ -48,10 +49,9 @@ class UserProfileCommentResponseOwnerUserNotificationEvent extends AbstractShare
         * @see \wcf\system\user\notification\event\IUserNotificationEvent::getMessage()
         */
        public function getMessage() {
-               // @todo: use cache or a single query to retrieve required data
-               $comment = new Comment($this->userNotificationObject->commentID);
+               $comment = CommentDataHandler::getInstance()->getComment($this->userNotificationObject->commentID);
                if ($comment->userID) {
-                       $commentAuthor = new User($comment->userID);
+                       $commentAuthor = CommentDataHandler::getInstance()->getUser($comment->userID);
                }
                else {
                        $commentAuthor = new User(null, array(
index 68b5eea6b457de1e5f14cbd7909a74f60e6dbfdc..03c5aad3e49b617921967550e0ea5b20c5725568 100644 (file)
@@ -48,7 +48,6 @@ class UserProfileCommentResponseUserNotificationEvent extends AbstractSharedUser
         * @see \wcf\system\user\notification\event\IUserNotificationEvent::getMessage()
         */
        public function getMessage() {
-               // @todo: use cache or a single query to retrieve required data
                $comment = CommentDataHandler::getInstance()->getComment($this->userNotificationObject->commentID);
                $owner = CommentDataHandler::getInstance()->getUser($comment->objectID);
                if ($comment->userID) {
@@ -96,7 +95,6 @@ class UserProfileCommentResponseUserNotificationEvent extends AbstractSharedUser
         * @see \wcf\system\user\notification\event\IUserNotificationEvent::getLink()
         */
        public function getLink() {
-               // @todo: use cache or a single query to retrieve required data
                $comment = CommentDataHandler::getInstance()->getComment($this->userNotificationObject->commentID);
                $user = CommentDataHandler::getInstance()->getUser($comment->objectID);
                
index 79ebf56894c3a6b417717ef7eabd4d98e5078123..cdcb1ba1d009330271aa659c6eca8ceb1a92aaf8 100644 (file)
@@ -2924,7 +2924,7 @@ Möchten Sie diese E-Mail-Benachrichtigung in Zukunft nicht mehr erhalten, könn
                <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 Kommentar an der <a href="{link controller='User' object=$owner}#wall{/link}">Pinnwand von {$owner->username}</a> geantwortet.]]></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 Kommentar an {if $owner->userID == $__wcf->getUser()->userID}<a href="{link controller='User' object=$owner}#wall{/link}">Ihrer Pinnwand</a>{else}der <a href="{link controller='User' object=$owner}#wall{/link}">Pinnwand von {$owner->username}</a>{/if} geantwortet.]]></item>
                <item name="wcf.user.notification.commentResponse.like.title"><![CDATA[Gefällt die Antwort auf einen Kommentar (Pinnwand)]]></item>
                <item name="wcf.user.notification.commentResponse.like.title.stacked"><![CDATA[{#$count} Benutzern gefällt Ihre Antwort auf einen Kommentar (Pinnwand)]]></item>
                <item name="wcf.user.notification.commentResponse.like.message"><![CDATA[Gefällt Ihre Antwort auf einen Kommentar an {if $owner === null}Ihrer Pinnwand{else}der Pinnwand von {$owner->username}{/if}.]]></item>
@@ -2948,6 +2948,8 @@ Möchten Sie diese E-Mail-Benachrichtigung in Zukunft nicht mehr erhalten, könn
                <item name="wcf.user.notification.com.woltlab.wcf.user.profileComment.notification.comment"><![CDATA[Neuer Kommentar an Ihrer Pinnwand]]></item>
                <item name="wcf.user.notification.com.woltlab.wcf.user.profileComment.response.notification.commentResponse"><![CDATA[Neue Antwort auf einen Kommentar an Ihrer Pinnwand]]></item>
                <item name="wcf.user.notification.com.woltlab.wcf.user.profileComment.response.notification.commentResponseOwner"><![CDATA[Neue Antwort auf einen Kommentar von Ihnen]]></item>
+               <item name="wcf.user.notification.com.woltlab.wcf.user.profileComment.like.notification.like"><![CDATA[Jemand gefällt Ihr Kommentar]]></item>
+               <item name="wcf.user.notification.com.woltlab.wcf.user.profileComment.response.like.notification.like"><![CDATA[Jemand gefällt Ihre Antwort auf einen Kommentar]]></item>
        </category>
        
        <category name="wcf.user.profile">
index 8d8185cad71c6dbfb21073173e597825f323f1f7..33642a064a6104b223d09bc9f9888e70e69be172 100644 (file)
@@ -2784,7 +2784,7 @@ If you do not want to receive further email notifications for this event, you ca
                <item name="wcf.user.notification.commentResponse.title"><![CDATA[New Reply (Wall)]]></item>
                <item name="wcf.user.notification.commentResponse.title.stacked"><![CDATA[{#$timesTriggered} new replies (Wall)]]></item>
                <item name="wcf.user.notification.commentResponse.message"><![CDATA[Wrote a reply to your comment on {$owner->username}’s wall.]]></item>
-               <item name="wcf.user.notification.commentResponse.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} and {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} and {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} and {#$count} others{/if} replied to your comment on <a href="{link controller='User' object=$owner}#wall{/link}">{$owner->username}’s wall</a>.]]></item>
+               <item name="wcf.user.notification.commentResponse.message.stacked"><![CDATA[{if $count < 4}{@$authors[0]->getAnchorTag()}{if $count == 2} and {else}, {/if}{@$authors[1]->getAnchorTag()}{if $count == 3} and {@$authors[2]->getAnchorTag()}{/if}{else}{@$authors[0]->getAnchorTag()} and {#$count} others{/if} replied to your comment on <a href="{link controller='User' object=$owner}#wall{/link}">{if $owner->userID == $__wcf->getUser()->userID}your{else}{$owner->username}’s{/if} wall</a>.]]></item>
                <item name="wcf.user.notification.commentResponse.like.title"><![CDATA[Likes your reply to a comment (Wall)]]></item>
                <item name="wcf.user.notification.commentResponse.like.title.stacked"><![CDATA[{#$count} users like your reply to a comment (Wall)]]></item>
                <item name="wcf.user.notification.commentResponse.like.message"><![CDATA[Likes your reply to a comment on {if $owner === null}your wall{else}{$owner->username}’s wall{/if}.]]></item>
@@ -2808,6 +2808,8 @@ If you do not want to receive further email notifications for this event, you ca
                <item name="wcf.user.notification.com.woltlab.wcf.user.profileComment.notification.comment"><![CDATA[New comment on your wall]]></item>
                <item name="wcf.user.notification.com.woltlab.wcf.user.profileComment.response.notification.commentResponse"><![CDATA[New reply to a comment on your wall]]></item>
                <item name="wcf.user.notification.com.woltlab.wcf.user.profileComment.response.notification.commentResponseOwner"><![CDATA[New reply to one of your comments]]></item>
+               <item name="wcf.user.notification.com.woltlab.wcf.user.profileComment.like.notification.like"><![CDATA[Your comment was liked]]></item>
+               <item name="wcf.user.notification.com.woltlab.wcf.user.profileComment.response.like.notification.like"><![CDATA[Reply to your comment was liked]]></item>
        </category>
        
        <category name="wcf.user.profile">