<definitionname>com.woltlab.wcf.like.likeableObject</definitionname>
<classname>wcf\data\article\LikeableArticleProvider</classname>
</type>
+ <type>
+ <name>com.woltlab.wcf.likeableArticle.recentActivityEvent</name>
+ <definitionname>com.woltlab.wcf.user.recentActivityEvent</definitionname>
+ <classname>wcf\system\user\activity\event\LikeableArticleUserActivityEvent</classname>
+ </type>
<type>
<name>com.woltlab.wcf.article</name>
<definitionname>com.woltlab.wcf.searchableObjectType</definitionname>
--- /dev/null
+<?php
+namespace wcf\system\user\activity\event;
+use wcf\data\article\ViewableArticleList;
+use wcf\system\SingletonFactory;
+use wcf\system\WCF;
+
+/**
+ * User activity event implementation for liked cms articles.
+ *
+ * @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.user.activity.event
+ * @category Community Framework
+ * @since 2.2
+ */
+class LikeableArticleUserActivityEvent extends SingletonFactory implements IUserActivityEvent {
+ /**
+ * @inheritDoc
+ */
+ public function prepare(array $events) {
+ $articleIDs = [];
+ foreach ($events as $event) {
+ $articleIDs[] = $event->objectID;
+ }
+
+ // fetch articles
+ $articleList = new ViewableArticleList();
+ $articleList->setObjectIDs($articleIDs);
+ $articleList->readObjects();
+ $articles = $articleList->getObjects();
+
+ // set message
+ foreach ($events as $event) {
+ if (isset($articles[$event->objectID])) {
+ $article = $articles[$event->objectID];
+
+ // check permissions
+ if (!$article->canRead()) {
+ continue;
+ }
+ $event->setIsAccessible();
+
+ // short output
+ $text = WCF::getLanguage()->getDynamicVariable('wcf.article.recentActivity.likedArticle', ['article' => $article]);
+ $event->setTitle($text);
+
+ // output
+ $event->setDescription($article->getTeaser());
+ }
+ else {
+ $event->setIsOrphaned();
+ }
+ }
+ }
+}
<item name="wcf.ajax.error.sessionExpired"><![CDATA[Ihre Sitzung ist abgelaufen, bitte melden Sie sich erneut an.]]></item>
</category>
+ <category name="wcf.article">
+ <item name="wcf.article.comments"><![CDATA[Kommentare]]></item>
+ <item name="wcf.article.nextArticle"><![CDATA[Nächster Artikel]]></item>
+ <item name="wcf.article.previousArticle"><![CDATA[Vorheriger Artikel]]></item>
+ <item name="wcf.article.relatedArticles"><![CDATA[Verwandte Artikel]]></item>
+ <item name="wcf.article.aboutAuthor"><![CDATA[Über den Autor]]></item>
+ <item name="wcf.article.articleComments"><![CDATA[{#$article->comments} Kommentar{if $article->comments != 1}e{/if}]]></item>
+ <item name="wcf.article.articleViews"><![CDATA[{#$article->views} mal gelesen]]></item>
+ <item name="wcf.article.recentActivity.likedArticle"><![CDATA[Mag den Artikel <a href="{$article->getLink()}">{$article->getTitle()}</a>.]]></item>
+ </category>
+
<category name="wcf.attachment">
<item name="wcf.attachment.file.info"><![CDATA[({@$attachment->filesize|filesize}, <b>{#$attachment->downloads}</b> mal heruntergeladen{if $attachment->downloads > 0}, zuletzt: {@$attachment->lastDownloadTime|time}{/if})]]></item>
<item name="wcf.attachment.image.info"><![CDATA[{@$attachment->filesize|filesize}, {#$attachment->width}×{#$attachment->height}, {#$attachment->downloads} mal angesehen]]></item>
<item name="wcf.user.recentActivity.com.woltlab.wcf.user.recentActivityEvent.follow"><![CDATA[Folgen]]></item>
<item name="wcf.user.recentActivity.com.woltlab.wcf.user.profileComment.recentActivityEvent"><![CDATA[Pinnwand-Kommentar]]></item>
<item name="wcf.user.recentActivity.com.woltlab.wcf.user.profileComment.response.recentActivityEvent"><![CDATA[Pinnwand-Antwort]]></item>
+ <item name="wcf.user.recentActivity.com.woltlab.wcf.likeableArticle.recentActivityEvent"><![CDATA[Like (Artikel)]]></item>
<item name="wcf.user.recentActivity.scope.all"><![CDATA[Aktivitäten aller Benutzer]]></item>
<item name="wcf.user.recentActivity.scope.followedUsers"><![CDATA[Aktivitäten von Benutzern, denen Sie folgen]]></item>
</category>
<item name="wcf.ajax.error.sessionExpired"><![CDATA[Your session expired, please login again.]]></item>
</category>
+ <category name="wcf.article">
+ <item name="wcf.article.comments"><![CDATA[Comments]]></item>
+ <item name="wcf.article.nextArticle"><![CDATA[Next Article]]></item>
+ <item name="wcf.article.previousArticle"><![CDATA[Previous Article]]></item>
+ <item name="wcf.article.relatedArticles"><![CDATA[Related Articles]]></item>
+ <item name="wcf.article.aboutAuthor"><![CDATA[About the Author]]></item>
+ <item name="wcf.article.articleComments"><![CDATA[{#$article->comments} Comment{if $article->comments != 1}s{/if}]]></item>
+ <item name="wcf.article.articleViews"><![CDATA[{#$article->views} View{if $article->views != 1}s{/if}]]></item>
+ <item name="wcf.article.recentActivity.likedArticle"><![CDATA[Liked the article <a href="{$article->getLink()}">{$article->getTitle()}</a>.]]></item>
+ </category>
+
<category name="wcf.attachment">
<item name="wcf.attachment.file.info"><![CDATA[({@$attachment->filesize|filesize}, downloaded <b>{#$attachment->downloads}</b> times{if $attachment->downloads > 0}, last: {@$attachment->lastDownloadTime|time}{/if})]]></item>
<item name="wcf.attachment.image.info"><![CDATA[{@$attachment->filesize|filesize}, {#$attachment->width}×{#$attachment->height}, viewed {#$attachment->downloads} times]]></item>
<item name="wcf.user.recentActivity.com.woltlab.wcf.user.recentActivityEvent.follow"><![CDATA[Follow]]></item>
<item name="wcf.user.recentActivity.com.woltlab.wcf.user.profileComment.recentActivityEvent"><![CDATA[Wall Comment]]></item>
<item name="wcf.user.recentActivity.com.woltlab.wcf.user.profileComment.response.recentActivityEvent"><![CDATA[Wall Reply]]></item>
+ <item name="wcf.user.recentActivity.com.woltlab.wcf.likeableArticle.recentActivityEvent"><![CDATA[Like (Article)]]></item>
<item name="wcf.user.recentActivity.scope.all"><![CDATA[All Activities]]></item>
<item name="wcf.user.recentActivity.scope.followedUsers"><![CDATA[Filter by Followed Users]]></item>
</category>