Fixed various issues concerning the package installation
authorAlexander Ebert <ebert@woltlab.com>
Fri, 19 Aug 2011 18:18:05 +0000 (20:18 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 19 Aug 2011 18:18:05 +0000 (20:18 +0200)
Package installation, update and deletion are properly working (at least in all of my test cases). Additionally reintroduced confirm messages before uninstalling any plugin. Maybe replace those ugly javascript prompts with some kind of overlay (would look like the same as the complete UI and is far less ugly)

wcfsetup/install/files/acp/js/WCF.ACP.js
wcfsetup/install/files/acp/templates/packageList.tpl
wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php

index 4b7a7aa2b0ea2363abcc6a852e7fcec5c481443c..c8690e004230b53e5173ce76c8d9bd0fd12750dc 100644 (file)
@@ -339,21 +339,24 @@ WCF.ACP.PackageUninstallation.prototype = {
         * @param       object          event
         */
        _createQueue: function(event) {
-               var packageID = $(event.target).data('objectID');
+               var $element = $(event.target);
+               var packageID = $element.data('objectID');
                
-               this._installation = new WCF.ACP.PackageInstallation('uninstall', 0, false);
-               
-               // initialize dialog
-               WCF.showAJAXDialog('packageInstallationDialog', true, {
-                       ajax: {
-                               url: 'index.php?action=UninstallPackage&t=' + SECURITY_TOKEN + SID_ARG_2ND,
-                               type: 'POST',
-                               data: { packageID: packageID, step: 'prepare' },
-                               success: $.proxy(this._installation._handleResponse, this._installation)
-                       },
-                       preventClose: true,
-                       hideTitle: true
-               });
+               if (confirm(WCF.Language.get('wcf.acp.package.view.button.uninstall.sure'))) {
+                       this._installation = new WCF.ACP.PackageInstallation('uninstall', 0, false);
+                       
+                       // initialize dialog
+                       WCF.showAJAXDialog('packageInstallationDialog', true, {
+                               ajax: {
+                                       url: 'index.php?action=UninstallPackage&t=' + SECURITY_TOKEN + SID_ARG_2ND,
+                                       type: 'POST',
+                                       data: { packageID: packageID, step: 'prepare' },
+                                       success: $.proxy(this._installation._handleResponse, this._installation)
+                               },
+                               preventClose: true,
+                               hideTitle: true
+                       });
+               }
        }
 };
 
index b1151254b88883f7da2550ef24e6a95269586345..0b81477c0da424ea5ee1dd5a42ee82aeca0c41a4 100644 (file)
@@ -60,7 +60,7 @@
                                                                <img src="{@RELATIVE_WCF_DIR}icon/update1D.svg" alt="" title="{lang}wcf.acp.package.view.button.update{/lang}" />
                                                        {/if}
                                                        {if $__wcf->session->getPermission('admin.system.package.canUninstallPackage') && $package->package != 'com.woltlab.wcf' && $package->packageID != PACKAGE_ID}
-                                                               <img src="{@RELATIVE_WCF_DIR}icon/delete1.svg" alt="" title="{lang}wcf.acp.package.view.button.uninstall{/lang}" class="uninstallButton balloonTooltip" data-objectID="{@$package->packageID}" data-confirmMessage="Are you sure?" />
+                                                               <img src="{@RELATIVE_WCF_DIR}icon/delete1.svg" alt="" title="{lang}wcf.acp.package.view.button.uninstall{/lang}" class="uninstallButton balloonTooltip" data-objectID="{@$package->packageID}" />
                                                        {else}
                                                                <img src="{@RELATIVE_WCF_DIR}icon/delete1D.svg" alt="" title="{lang}wcf.acp.package.view.button.uninstall{/lang}" />
                                                        {/if}
index 460a9cebf53f6677106b7a8fe12761a7539b496e..7c1f3580863b7422b5496d5e0bdcdf5c9ded6e8b 100755 (executable)
@@ -251,8 +251,8 @@ class PackageStartInstallForm extends ACPForm {
         * @see wcf\page\IPage::show()
         */
        public function show() {
-               if ($this->action == 'install') WCF::getSession()->checkPermission(array('admin.system.package.canInstallPackage'));
-               else WCF::getSession()->checkPermission(array('admin.system.package.canUpdatePackage'));
+               if ($this->action == 'install') WCF::getSession()->checkPermissions(array('admin.system.package.canInstallPackage'));
+               else WCF::getSession()->checkPermissions(array('admin.system.package.canUpdatePackage'));
                
                // check master password
                WCFACP::checkMasterPassword();