Provide an uninstall button from within the details page of a package
authorAlexander Ebert <ebert@woltlab.com>
Fri, 14 Jan 2022 12:22:52 +0000 (13:22 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 14 Jan 2022 12:22:52 +0000 (13:22 +0100)
Replaces #4631

wcfsetup/install/files/acp/templates/package.tpl

index f2d1e35990635ab6314e9453f2388baadc51e315..dc8dcb46f22fd1023288c9ec1ba053843cf38f33 100644 (file)
        {hascontent}
                <nav class="contentHeaderNavigation">
                        <ul>
-                               {content}{event name='contentHeaderNavigation'}{/content}
+                               {content}
+                                       {if $package->canUninstall()}
+                                               <li><button class="jsUninstallButton" data-object-id="{@$package->packageID}" data-confirm-message="{lang __encode=true}wcf.acp.package.uninstallation.confirm{/lang}" data-is-required="{if $package->isRequired()}true{else}false{/if}" data-is-application="{if $package->isApplication}true{else}false{/if}"><span class="icon icon16 fa-times"></span> <span>{lang}wcf.acp.package.button.uninstall{/lang}</span></button></li>
+                                       {/if}
+
+                                       {event name='contentHeaderNavigation'}
+                               {/content}
                        </ul>
                </nav>
        {/hascontent}