Uninstallation should now properly prompt
authorAlexander Ebert <ebert@woltlab.com>
Tue, 6 Mar 2012 18:49:24 +0000 (19:49 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 6 Mar 2012 18:49:24 +0000 (19:49 +0100)
wcfsetup/install/files/acp/js/WCF.ACP.js
wcfsetup/install/files/acp/templates/packageListDetailed.tpl
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index e7fd95fcb09ebe7c5c5d308cd9513b515c7691e7..66478f30fbd5a543675bd8b44227a4cc6080422a 100644 (file)
@@ -489,32 +489,43 @@ WCF.ACP.Package.Uninstallation.prototype = {
                
                // bind event listener
                elements.each($.proxy(function(index, element) {
-                       $(element).click($.proxy(this._createQueue, this));
+                       $(element).click($.proxy(this._prepareQueue, this));
                }, this));
        },
        
        /**
-        * Creates a new package uninstallation process.
+        * Prepares a new package uninstallation process.
         * 
         * @param       object          event
         */
-       _createQueue: function(event) {
+       _prepareQueue: function(event) {
                var $element = $(event.target);
-               var packageID = $element.data('objectID');
                
-               if (confirm(WCF.Language.get('wcf.acp.package.view.button.uninstall.sure'))) {
-                       this._installation = new WCF.ACP.Package.Installation('uninstall', 0, false);
-                       
-                       // initialize dialog
-                       WCF.showAJAXDialog('packageInstallationDialog', true, {
-                               ajax: true,
-                               closable: false,
-                               data: { packageID: packageID, step: 'prepare' },
-                               success: $.proxy(this._installation._handleResponse, this._installation),
-                               title: 'wcf.acp.package.uninstall.title',
-                               url: 'index.php/UninstallPackage/?t=' + SECURITY_TOKEN + SID_ARG_2ND
-                       });
+               WCF.System.Confirmation.show($element.data('confirmMessage'), $.proxy(this._createQueue, this), { packageID: $element.data('objectID') });
+       },
+       
+       /**
+        * Initializes a new package uninstallation process.
+        * 
+        * @param       string          action
+        * @param       object          parameters
+        */
+       _createQueue: function(action, parameters) {
+               if (action !== 'confirm') {
+                       return;
                }
+               
+               this._installation = new WCF.ACP.Package.Installation('uninstall', 0, false);
+               
+               // initialize dialog
+               WCF.showAJAXDialog('packageInstallationDialog', true, {
+                       ajax: true,
+                       closable: false,
+                       data: { packageID: parameters.packageID, step: 'prepare' },
+                       success: $.proxy(this._installation._handleResponse, this._installation),
+                       title: 'wcf.acp.package.uninstall.title',
+                       url: 'index.php/UninstallPackage/?t=' + SECURITY_TOKEN + SID_ARG_2ND
+               });
        }
 };
 
index 423143c3e0f14b0652f5359256c54665fe3fe18e..b6504470509a0a0cf0eba5e34cf9250daebe2a52 100644 (file)
@@ -64,7 +64,7 @@
                                                                <img src="{@$__wcf->getPath()}icon/update1D.svg" alt="" title="{lang}wcf.acp.package.button.update{/lang}" />
                                                        {/if}
                                                        {if $__wcf->session->getPermission('admin.system.package.canUninstallPackage') && $package->package != 'com.woltlab.wcf' && $package->packageID != PACKAGE_ID}
-                                                               <img src="{@$__wcf->getPath()}icon/delete1.svg" alt="" title="{lang}wcf.acp.package.button.uninstall{/lang}" data-object-id="{@$package->packageID}" class="jsUninstallButton jsTooltip" />
+                                                               <img src="{@$__wcf->getPath()}icon/delete1.svg" alt="" title="{lang}wcf.acp.package.button.uninstall{/lang}" class="jsUninstallButton jsTooltip" data-object-id="{@$package->packageID}" data-confirmMessage="{lang}wcf.acp.package.uninstallation.confirm{/lang}" />
                                                        {else}
                                                                <img src="{@$__wcf->getPath()}icon/delete1D.svg" alt="" title="{lang}wcf.acp.package.button.uninstall{/lang}" />
                                                        {/if}
index e5e17a8fddc33e31ac32d51e828e10f58d62ba72..e6b97fa997e564ed8b574265a4790addb26063dc 100644 (file)
                <item name="wcf.acp.package.type.application"><![CDATA[Anwendung]]></item>
                <item name="wcf.acp.package.type.other"><![CDATA[Basispaket]]></item>
                <item name="wcf.acp.package.type.plugin"><![CDATA[Erweiterung]]></item>
+               <item name="wcf.acp.package.uninstallation.confirm"><![CDATA[Wollen Sie das Paket &bdquo;{@$package->getName()}&ldquo; wirklich deinstallieren?]]></item>
                <item name="wcf.acp.package.updateDate"><![CDATA[Aktualisierungsdatum]]></item>
                <item name="wcf.acp.package.version"><![CDATA[Version]]></item>
        </category>
index 411c7990a79d053c7f381d4e83c8b49c42f1b5d3..09b452d1fbf1a6b6566b27837d92c233555c46a8 100644 (file)
                <item name="wcf.acp.package.type.application"><![CDATA[Application]]></item>
                <item name="wcf.acp.package.type.other"><![CDATA[Base package]]></item>
                <item name="wcf.acp.package.type.plugin"><![CDATA[Extension]]></item>
+               <item name="wcf.acp.package.uninstallation.confirm"><![CDATA[Do you really want to uninstall the package &ldquo;{@$package->getName()}&rdquo;?]]></item>
                <item name="wcf.acp.package.updateDate"><![CDATA[Update date]]></item>
                <item name="wcf.acp.package.version"><![CDATA[Version]]></item>
        </category>