Use `Ui/Object/Action/Delete` in more places in ACP
authorMatthias Schmidt <gravatronics@live.com>
Sun, 21 Mar 2021 08:54:16 +0000 (09:54 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 21 Mar 2021 09:21:40 +0000 (10:21 +0100)
wcfsetup/install/files/acp/templates/attachmentList.tpl
wcfsetup/install/files/acp/templates/categoryList.tpl
wcfsetup/install/files/acp/templates/paidSubscriptionUserList.tpl
wcfsetup/install/files/acp/templates/userTrophyList.tpl

index 748f7f4e0a5e65aa1c60c02c67eeec8b04ea0e01..dfbf480c92356871e8be77682e6a71c6d81b15a2 100644 (file)
@@ -4,7 +4,6 @@
 {include file='imageViewer'}
 <script data-relocate="true">
        $(function() {
-               new WCF.Action.Delete('wcf\\data\\attachment\\AttachmentAction', '.jsAttachmentRow');
                new WCF.Search.User('#username', null, false, [ ], true);
        });
 </script>
@@ -82,7 +81,7 @@
 
 {if $objects|count}
        <div class="section tabularBox">
-               <table class="table">
+               <table class="table jsObjectActionContainer" data-object-action-class-name="wcf\data\attachment\AttachmentAction"
                        <thead>
                                <tr>
                                        <th class="columnID columnAttachmentID{if $sortField == 'attachmentID'} active {@$sortOrder}{/if}" colspan="2"><a href="{link controller='AttachmentList'}pageNo={@$pageNo}&sortField=attachmentID&sortOrder={if $sortField == 'attachmentID' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{@$linkParameters}{/link}">{lang}wcf.global.objectID{/lang}</a></th>
@@ -98,9 +97,9 @@
                        
                        <tbody class="jsReloadPageWhenEmpty">
                                {foreach from=$objects item=attachment}
-                                       <tr class="jsAttachmentRow">
+                                       <tr class="jsAttachmentRow jsObjectActionObject" data-object-id="{@$attachment->getObjectID()}">
                                                <td class="columnIcon">
-                                                       <span class="icon icon16 fa-times jsDeleteButton jsTooltip pointer" title="{lang}wcf.global.button.delete{/lang}" data-object-id="{@$attachment->attachmentID}" data-confirm-message="{lang}wcf.attachment.delete.sure{/lang}"></span>
+                                                       {objectAction action="delete" objectTitle=$attachment->filename|tableWordwrap}
                                                        
                                                        {event name='rowButtons'}
                                                </td>
index 31f89aedf077ccd54aa2b7d1612cb17d7af1c61e..ad8da0d806e01d96e87f3090628d2a2f33cb0b1f 100644 (file)
@@ -7,9 +7,6 @@
                                new WCF.ACP.Category.Collapsible('wcf\\data\\category\\CategoryAction', {@$collapsibleObjectTypeID});
                        {/if}
                        
-                       {if $objectType->getProcessor()->canDeleteCategory()}
-                               new WCF.Action.NestedDelete('wcf\\data\\category\\CategoryAction', '.jsCategory');
-                       {/if}
                        {if $objectType->getProcessor()->canEditCategory()}
                                var sortableNodes = $('.sortableNode');
                                sortableNodes.each(function(index, node) {
                                                                {/if}
                                                                
                                                                {if $objectType->getProcessor()->canDeleteCategory()}
-                                                                       <span class="icon icon16 fa-times jsDeleteButton jsTooltip pointer" title="{lang}wcf.global.button.delete{/lang}" data-object-id="{@$category->categoryID}" data-confirm-message="{@$objectType->getProcessor()->getLanguageVariable('delete.sure')}"></span>
+                                                                       {objectAction action="delete" objectTitle=$category->getTitle()}
                                                                {/if}
                                                                
                                                                {event name='itemButtons'}
                                                        </span>
                                                </span>
                                                
-                                               <ol class="categoryList sortableList" data-object-id="{@$category->categoryID}">{if !$categoryNodeList->current()->hasChildren()}</ol></li>{/if}
+                                               <ol class="categoryList sortableList jsObjectActionObjectChildren" data-object-id="{@$category->categoryID}">{if !$categoryNodeList->current()->hasChildren()}</ol></li>{/if}
                                        {assign var=oldDepth value=$categoryNodeList->getDepth()}
                                {/foreach}
                                {section name=i loop=$oldDepth}</ol></li>{/section}
index b1e229f09b2cf483b8e75c5a2edf2c73820dfc96..f276d2ada7c971e41ad0d64f8400d14f0e4d05b0 100644 (file)
@@ -2,7 +2,6 @@
 
 <script data-relocate="true">
        $(function() {
-               new WCF.Action.Delete('wcf\\data\\paid\\subscription\\user\\PaidSubscriptionUserAction', '.jsPaidSubscriptionUserRow');
                new WCF.Search.User('#username');
        });
 </script>
@@ -69,7 +68,7 @@
 
 {if $objects|count}
        <div class="section tabularBox">
-               <table class="table">
+               <table class="table jsObjectActionContainer" data-object-action-class-name="wcf\data\paid\subscription\user\PaidSubscriptionUserAction"
                        <thead>
                                <tr>
                                        <th class="columnID columnSubscriptionUserID{if $sortField == 'subscriptionUserID'} active {@$sortOrder}{/if}" colspan="2"><a href="{link controller='PaidSubscriptionUserList'}pageNo={@$pageNo}&sortField=subscriptionUserID&sortOrder={if $sortField == 'subscriptionUserID' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{@$linkParameters}{/link}">{lang}wcf.global.objectID{/lang}</a></th>
                        
                        <tbody class="jsReloadPageWhenEmpty">
                                {foreach from=$objects item=subscriptionUser}
-                                       <tr class="jsPaidSubscriptionUserRow">
+                                       <tr class="jsPaidSubscriptionUserRow jsObjectActionObject" data-object-id="{@$subscriptionUser->getObjectID()}">
                                                <td class="columnIcon">
                                                        {if $subscriptionUser->endDate}
                                                                <a href="{link controller='PaidSubscriptionUserEdit' id=$subscriptionUser->subscriptionUserID}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip"><span class="icon icon16 fa-pencil"></span></a>
                                                        {else}
                                                                <span class="icon icon16 fa-pencil disabled"></span>
                                                        {/if}
-                                                       <span class="icon icon16 fa-times jsDeleteButton jsTooltip pointer" title="{lang}wcf.global.button.delete{/lang}" data-object-id="{@$subscriptionUser->subscriptionUserID}" data-confirm-message-html="{lang __encode=true}wcf.acp.paidSubscription.user.delete.confirmMessage{/lang}"></span>
+                                                       {objectAction action="delete" confirmMessage='wcf.acp.paidSubscription.user.delete.confirmMessage'}
                                                        
                                                        {event name='itemButtons'}
                                                </td>
index e591a4b32bb7627e2276b5a20614f8ac16283a69..ad8635a2864fbdd8adb651c3fcacc2f6e2f891c4 100644 (file)
@@ -4,7 +4,6 @@
        //<![CDATA[
        $(function() {
                new WCF.Search.User('#username');
-               new WCF.Action.Delete('wcf\\data\\user\\trophy\\UserTrophyAction', '.userTrophyRow');
        });
        //]]>
 </script>
@@ -77,8 +76,8 @@
 
 {if $objects|count}
        <div class="section tabularBox">
-
-               <table class="table">
+               
+               <table class="table jsObjectActionContainer" data-object-action-class-name="wcf\data\user\trophy\UserTrophyAction">
                        <thead>
                        <tr>
                                <th class="columnID columnUserTrophyID{if $sortField == 'userTrophyID'} active {@$sortOrder}{/if}" colspan="2"><a href="{link controller='UserTrophyList'}pageNo={@$pageNo}&sortField=userTrophyID&sortOrder={if $sortField == 'userTrophyID' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{@$linkParameters}{/link}">{lang}wcf.global.objectID{/lang}</a></th>
                        </thead>
 
                        <tbody class="jsReloadPageWhenEmpty">
-                       {foreach from=$objects item=userTrophy}
-                               <tr class="userTrophyRow">
-                                       <td class="columnIcon">
-                                               {if $userTrophy->getTrophy()->awardAutomatically}
-                                                       <span class="icon icon16 fa-pencil disabled" title="{lang}wcf.global.button.edit{/lang}"></span>
-                                                       <span class="icon icon16 fa-times disabled" title="{lang}wcf.global.button.delete{/lang}"></span>
-                                               {else}
-                                                       <a href="{link controller='UserTrophyEdit' id=$userTrophy->userTrophyID}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip"><span class="icon icon16 fa-pencil{if $userTrophy->getTrophy()->awardAutomatically} disabled{/if}"></span></a>
-                                                       <span class="icon icon16 fa-times pointer jsDeleteButton jsTooltip{if $userTrophy->getTrophy()->awardAutomatically} disabled{/if}" data-confirm-message-html="{lang __encode="true"}wcf.acp.trophy.userTrophy.delete.confirmMessage{/lang}" data-object-id="{@$userTrophy->getObjectID()}" title="{lang}wcf.global.button.delete{/lang}"></span>
-                                               {/if}
-                                       </td>
-                                       <td class="columnID columnUserTrophyID">{@$userTrophy->userTrophyID}</td>
-                                       <td class="columnText columnUsername"><a href="{link controller='UserEdit' id=$userTrophy->userID}{/link}" title="{lang}wcf.acp.user.edit{/lang}">{$userTrophy->getUserProfile()->username}</a></td>
-                                       <td class="columnTitle columnTrophy">{$userTrophy->getTrophy()->getTitle()}</td>
-                                       <td class="columnDate columnUserTrophyTime">{@$userTrophy->time|time}</td>
-
-                                       {event name='columns'}
-                               </tr>
-                       {/foreach}
+                               {foreach from=$objects item=userTrophy}
+                                       <tr class="userTrophyRow jsObjectActionObject" data-object-id="{@$userTrophy->getObjectID()}">
+                                               <td class="columnIcon">
+                                                       {if $userTrophy->getTrophy()->awardAutomatically}
+                                                               <span class="icon icon16 fa-pencil disabled" title="{lang}wcf.global.button.edit{/lang}"></span>
+                                                               <span class="icon icon16 fa-times disabled" title="{lang}wcf.global.button.delete{/lang}"></span>
+                                                       {else}
+                                                               <a href="{link controller='UserTrophyEdit' id=$userTrophy->userTrophyID}{/link}" title="{lang}wcf.global.button.edit{/lang}" class="jsTooltip"><span class="icon icon16 fa-pencil{if $userTrophy->getTrophy()->awardAutomatically} disabled{/if}"></span></a>
+                                                               {objectAction action="delete" confirmMessage='wcf.acp.trophy.userTrophy.delete.confirmMessage'}
+                                                       {/if}
+                                               </td>
+                                               <td class="columnID columnUserTrophyID">{@$userTrophy->userTrophyID}</td>
+                                               <td class="columnText columnUsername"><a href="{link controller='UserEdit' id=$userTrophy->userID}{/link}" title="{lang}wcf.acp.user.edit{/lang}">{$userTrophy->getUserProfile()->username}</a></td>
+                                               <td class="columnTitle columnTrophy">{$userTrophy->getTrophy()->getTitle()}</td>
+                                               <td class="columnDate columnUserTrophyTime">{@$userTrophy->time|time}</td>
+                                               
+                                               {event name='columns'}
+                                       </tr>
+                               {/foreach}
                        </tbody>
                </table>