This gives administrators a quick overview which reaction types are enabled and which are not.
Closes #3094
$(function() {
new WCF.Action.Delete('wcf\\data\\reaction\\type\\ReactionTypeAction', '.reactionTypeRow');
+ new WCF.Action.Toggle('wcf\\data\\reaction\\type\\ReactionTypeAction', '.reactionTypeRow');
});
</script>
{/if}
<span class="statusDisplay sortableButtonContainer">
<span class="icon icon16 fa-arrows sortableNodeHandle"></span>
+ <span class="jsOnly icon icon16 fa-{if $reactionType->isAssignable}check-{/if}square-o jsToggleButton jsTooltip pointer" title="{lang}wcf.acp.reactionType.is{if !$reactionType->isAssignable}Not{/if}Assignable{/lang}" data-disable-title="{lang}wcf.acp.reactionType.isAssignable{/lang}" data-enable-title="{lang}wcf.acp.reactionType.isNotAssignable{/lang}" data-object-id="{@$reactionType->reactionTypeID}"></span>
<a href="{link controller='ReactionTypeEdit' id=$reactionType->reactionTypeID}{/link}"><span title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip icon icon16 fa-pencil"></span></a>
<span title="{lang}wcf.global.button.delete{/lang}" class="jsDeleteButton pointer jsTooltip icon icon16 fa-times" data-object-id="{@$reactionType->reactionTypeID}" data-confirm-message-html="{lang __encode=true}wcf.acp.reactionType.delete.confirmMessage{/lang}"></span>
namespace wcf\data\reaction\type;
use wcf\data\AbstractDatabaseObjectAction;
use wcf\data\ISortableAction;
+use wcf\data\IToggleAction;
+use wcf\data\TDatabaseObjectToggle;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\exception\UserInputException;
use wcf\system\file\upload\UploadFile;
* @method ReactionTypeEditor[] getObjects()
* @method ReactionTypeEditor getSingleObject()
*/
-class ReactionTypeAction extends AbstractDatabaseObjectAction implements ISortableAction {
+class ReactionTypeAction extends AbstractDatabaseObjectAction implements ISortableAction, IToggleAction {
+ use TDatabaseObjectToggle;
+
/**
* @inheritDoc
*/
return $returnValues;
}
+
+ /**
+ * @inheritDoc
+ */
+ public function toggle() {
+ foreach ($this->getObjects() as $object) {
+ $object->update([
+ 'isAssignable' => $object->isAssignable ? 0 : 1
+ ]);
+ }
+ }
}
<item name="wcf.acp.reactionType.type"><![CDATA[Reaktions-Typ]]></item>
<item name="wcf.acp.reactionType.image"><![CDATA[Reaktions-Datei]]></item>
<item name="wcf.acp.reactionType.showOrder.description"><![CDATA[Der Reaktions-Typ wird nach dem ausgewählten Reaktions-Typ angezeigt.]]></item>
- <item name="wcf.acp.reactionType.isAssignable"><![CDATA[Kann verwendet werden]]></item>
+ <item name="wcf.acp.reactionType.isAssignable"><![CDATA[Verwendung erlauben]]></item>
<item name="wcf.acp.reactionType.isAssignable.description"><![CDATA[Wenn eine Reaktion nicht verwendet werden kann, können Benutzer nicht mit der Reaktion reagieren. Wurde auf einen Inhalt bereits mit der Reaktion reagiert, ist sie auch weiterhin für Benutzer sichtbar.]]></item>
+ <item name="wcf.acp.reactionType.isNotAssignable"><![CDATA[Verwendung verbieten]]></item>
</category>
<category name="wcf.acp.rebuildData">
<item name="wcf.acp.rebuildData"><![CDATA[Anzeigen aktualisieren]]></item>
<item name="wcf.acp.reactionType.type"><![CDATA[Reaction Type]]></item>
<item name="wcf.acp.reactionType.image"><![CDATA[Reaction File]]></item>
<item name="wcf.acp.reactionType.showOrder.description"><![CDATA[The reaction type will be shown after the selected reaction type.]]></item>
- <item name="wcf.acp.reactionType.isAssignable"><![CDATA[Can be assigend]]></item>
+ <item name="wcf.acp.reactionType.isAssignable"><![CDATA[Allow use]]></item>
<item name="wcf.acp.reactionType.isAssignable.description"><![CDATA[If a reaction cannot be used, users cannot react with the reaction. If a content has already been reacted to with the reaction, it remains visible to users.]]></item>
+ <item name="wcf.acp.reactionType.isNotAssignable"><![CDATA[Disallow use]]></item>
</category>
<category name="wcf.acp.rebuildData">
<item name="wcf.acp.rebuildData"><![CDATA[Rebuild Data]]></item>