Add list toggle for reaction types
authorJoshua Rüsweg <ruesweg@woltlab.com>
Mon, 29 Jul 2019 15:34:22 +0000 (17:34 +0200)
committerJoshua Rüsweg <ruesweg@woltlab.com>
Mon, 29 Jul 2019 15:34:22 +0000 (17:34 +0200)
Closes #2997

wcfsetup/install/files/acp/templates/reactionTypeList.tpl
wcfsetup/install/files/lib/data/reaction/type/ReactionTypeAction.class.php

index d2f95162c48f916ec26230e66c867b0de01880c9..fdf7e6a53b896d8953bd7e51acc0dba9bd01ea8f 100644 (file)
@@ -11,7 +11,8 @@
                });
                
                $(function() {
-                       new WCF.Action.Delete('wcf\\data\\reaction\\type\\ReactionTypeAction', $('.reactionTypeRow'));
+                       new WCF.Action.Delete('wcf\\data\\reaction\\type\\ReactionTypeAction', '.reactionTypeRow');
+                       new WCF.Action.Toggle('wcf\\data\\reaction\\type\\ReactionTypeAction', '.reactionTypeRow');
                });
        </script>
 {/if}
@@ -47,6 +48,7 @@
                                                        
                                                        <span class="statusDisplay sortableButtonContainer">
                                                                <span class="icon icon16 fa-arrows sortableNodeHandle"></span>
+                                                               <span class="icon icon16 fa-{if !$reactionType->isDisabled}check-{/if}square-o jsToggleButton jsTooltip pointer" title="{lang}wcf.global.button.{if $reactionType->isDisabled}enable{else}disable{/if}{/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>
                                                                
index 3bdae6773ca02138ceb0ada36718a056d92435ca..2d3c0563995cffe17ce92c2784375e19879875b1 100644 (file)
@@ -2,6 +2,8 @@
 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;
@@ -20,7 +22,9 @@ use wcf\system\WCF;
  * @method     ReactionTypeEditor[]            getObjects()
  * @method     ReactionTypeEditor              getSingleObject()
  */
-class ReactionTypeAction extends AbstractDatabaseObjectAction implements ISortableAction {
+class ReactionTypeAction extends AbstractDatabaseObjectAction implements ISortableAction, IToggleAction {
+       use TDatabaseObjectToggle;
+       
        /**
         * @inheritDoc
         */