{event name='beforeArticleContent'}
- <div class="section articleContent"
- data-object-id="{@$article->articleID}"
- data-object-type="com.woltlab.wcf.likeableArticle"
- data-like-liked="{if $articleLikeData[$article->articleID]|isset}{@$articleLikeData[$article->articleID]->liked}{/if}"
- data-like-likes="{if $articleLikeData[$article->articleID]|isset}{@$articleLikeData[$article->articleID]->likes}{else}0{/if}"
- data-like-dislikes="{if $articleLikeData[$article->articleID]|isset}{@$articleLikeData[$article->articleID]->dislikes}{else}0{/if}"
- data-like-users='{ {if $articleLikeData[$article->articleID]|isset}{implode from=$articleLikeData[$article->articleID]->getUsers() item=likeUser}"{@$likeUser->userID}": "{$likeUser->username|encodeJSON}"{/implode}{/if} }'
- data-user-id="{@$article->userID}"
- >
+ <div class="section articleContent" {@$__wcf->getReactionHandler()->getDataAttributes('com.woltlab.wcf.likeableArticle', $article->articleID)}>
<div class="htmlContent">
{if $articleContent->teaser}
<p class="articleTeaser">{@$articleContent->getFormattedTeaser()}</p>
<div class="row articleLikeSection">
<div class="col-xs-12 col-md-6">
- <div class="articleLikesSummery"></div>
+ <div class="articleLikesSummery">
+ {include file="reactionSummaryList" reactionData=$articleLikeData objectType="com.woltlab.wcf.likeableArticle" objectID=$article->articleID}
+ </div>
</div>
<div class="col-xs-12 col-md-6">
- <ul class="articleLikeButtons buttonGroup"></ul>
+ <ul class="articleLikeButtons buttonGroup">
+ <li class="jsOnly"><span class="button reactButton{if $articleLikeData[$article->articleID]|isset && $articleLikeData[$article->articleID]->reactionTypeID} active{/if}" title="{lang}wcf.reactions.react{/lang}">{if $articleLikeData[$article->articleID]|isset && $articleLikeData[$article->articleID]->reactionTypeID}{@$__wcf->getReactionHandler()->getReactionTypeByID($articleLikeData[$article->articleID]->reactionTypeID)->renderIcon()}{else}<img src="{$__wcf->getPath()}/images/reaction/reactionIcon.svg" style="width:24px;height:24px;" alt="">{/if}</span></li>
+ </ul>
</div>
</div>
</div>
{if MODULE_LIKE && ARTICLE_ENABLE_LIKE}
<script data-relocate="true">
- require(['WoltLabSuite/Core/Ui/Like/Handler'], function(UiLikeHandler) {
+ require(['WoltLabSuite/Core/Ui/Reaction/Handler'], function(UiLikeHandler) {
new UiLikeHandler('com.woltlab.wcf.likeableArticle', {
- // settings
- isSingleItem: true,
-
// permissions
- canDislike: {if LIKE_ENABLE_DISLIKE}true{else}false{/if},
- canLike: {if $__wcf->getUser()->userID}true{else}false{/if},
- canLikeOwnContent: {if LIKE_ALLOW_FOR_OWN_CONTENT}true{else}false{/if},
- canViewSummary: {if LIKE_SHOW_SUMMARY}true{else}false{/if},
+ canReact: {if $__wcf->getUser()->userID}true{else}false{/if},
+ canReactToOwnContent: {if LIKE_ALLOW_FOR_OWN_CONTENT}true{else}false{/if},
+ canViewReactions: {if LIKE_SHOW_SUMMARY}true{else}false{/if},
// selectors
- badgeContainerSelector: '.articleLikesBadge',
- buttonAppendToSelector: '.articleLikeButtons',
containerSelector: '.articleContent',
summarySelector: '.articleLikesSummery'
});
else if (REACTION_TYPES[key] !== undefined) {
// create element
var createdElement = elCreate('li');
- createdElement.className = 'button small reactCountButton';
+ createdElement.className = 'reactCountButton';
createdElement.innerHTML = REACTION_TYPES[key].renderedIcon +' ';
elData(createdElement, 'reaction-type-id', key);
use wcf\data\like\object\LikeObject;
use wcf\system\comment\manager\ICommentManager;
use wcf\system\comment\CommentHandler;
-use wcf\system\like\LikeHandler;
+use wcf\system\reaction\ReactionHandler;
use wcf\system\request\LinkHandler;
use wcf\system\MetaTagHandler;
use wcf\system\WCF;
// fetch likes
if (MODULE_LIKE) {
- $objectType = LikeHandler::getInstance()->getObjectType('com.woltlab.wcf.likeableArticle');
- LikeHandler::getInstance()->loadLikeObjects($objectType, [$this->article->articleID]);
- $this->articleLikeData = LikeHandler::getInstance()->getLikeObjects($objectType);
+ $objectType = ReactionHandler::getInstance()->getObjectType('com.woltlab.wcf.likeableArticle');
+ ReactionHandler::getInstance()->loadLikeObjects($objectType, [$this->article->articleID]);
+ $this->articleLikeData = ReactionHandler::getInstance()->getLikeObjects($objectType);
}
// add meta/og tags
$event->setIsAccessible();
// short output
- $text = WCF::getLanguage()->getDynamicVariable('wcf.article.recentActivity.likedArticle', ['article' => $article]);
+ $text = WCF::getLanguage()->getDynamicVariable('wcf.article.recentActivity.likedArticle', [
+ 'article' => $article,
+ 'reactionType' => $event->reactionType
+ ]);
$event->setTitle($text);
// output
<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>
+ <item name="wcf.article.recentActivity.likedArticle"><![CDATA[Hat mit „{$reactionType->getTitle()}“ auf den Artikel <a href="{$article->getLink()}">{$article->getTitle()}</a> reagiert.]]></item>
<item name="wcf.article.recentActivity.articleComment"><![CDATA[Hat einen Kommentar zum Artikel <a href="{$article->getLink()}#comment{$commentID}">{$article->getTitle()}</a> geschrieben.]]></item>
<item name="wcf.article.recentActivity.articleCommentResponse"><![CDATA[Hat auf einen Kommentar von <a href="{link controller='User' object=$commentAuthor}{/link}">{$commentAuthor->username}</a> zum Artikel <a href="{$article->getLink()}#comment{@$commentID}/response{@$responseID}">{$article->getTitle()}</a> geantwortet.]]></item>
<item name="wcf.article.search.categories"><![CDATA[Folgende Kategorien durchsuchen]]></item>
<item name="wcf.poll.endTimeInfo"><![CDATA[Umfrage endet am {@$poll->endTime|plainTime}]]></item>
</category>
+ <category name="wcf.reactions">
+ <item name="wcf.reactions.summary.title"><![CDATA[Reaktionen]]></item>
+ <item name="wcf.reactions.summary.noReactions"><![CDATA[Es gibt bisher keine Reaktionen dieses Types auf das Objekt.]]></item>
+ <item name="wcf.reactions.summary.listReactions"><![CDATA[Reaktionen auflisten]]></item>
+ <item name="wcf.reactions.react"><![CDATA[Reagieren]]></item>
+ </category>
+
<category name="wcf.recaptcha">
<item name="wcf.recaptcha.title"><![CDATA[Sicherheitsabfrage („reCAPTCHA“)]]></item>
<item name="wcf.recaptcha.description"><![CDATA[Bitte {if LANGUAGE_USE_INFORMAL_VARIANT}gib{else}geben Sie{/if} die untenstehenden Zeichen in das leere Feld ein. Groß- und Kleinschreibung müssen nicht beachtet werden. {if LANGUAGE_USE_INFORMAL_VARIANT}Solltest du{else}Sollten Sie{/if} das Bild trotz Neuladen nicht identifizieren können, {if LANGUAGE_USE_INFORMAL_VARIANT}wende dich{else}wenden Sie sich{/if} an den Administrator.]]></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.com.woltlab.wcf.likeableArticle.recentActivityEvent"><![CDATA[Reaktion (Artikel)]]></item>
<item name="wcf.user.recentActivity.com.woltlab.wcf.articleComment.recentActivityEvent"><![CDATA[Kommentar (Artikel)]]></item>
<item name="wcf.user.recentActivity.com.woltlab.wcf.articleComment.response.recentActivityEvent"><![CDATA[Antwort (Artikel)]]></item>
<item name="wcf.user.recentActivity.com.woltlab.wcf.userTrophy.recentActivityEvent.trophyReceived"><![CDATA[Trophäe]]></item>