From 3a8046843c04da361b2ded172684c4eeeb9fa8c5 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 19 Aug 2011 20:18:05 +0200 Subject: [PATCH] Fixed various issues concerning the package installation 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 | 31 ++++++++++--------- .../files/acp/templates/packageList.tpl | 2 +- .../form/PackageStartInstallForm.class.php | 4 +-- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/wcfsetup/install/files/acp/js/WCF.ACP.js b/wcfsetup/install/files/acp/js/WCF.ACP.js index 4b7a7aa2b0..c8690e0042 100644 --- a/wcfsetup/install/files/acp/js/WCF.ACP.js +++ b/wcfsetup/install/files/acp/js/WCF.ACP.js @@ -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 + }); + } } }; diff --git a/wcfsetup/install/files/acp/templates/packageList.tpl b/wcfsetup/install/files/acp/templates/packageList.tpl index b1151254b8..0b81477c0d 100644 --- a/wcfsetup/install/files/acp/templates/packageList.tpl +++ b/wcfsetup/install/files/acp/templates/packageList.tpl @@ -60,7 +60,7 @@ {/if} {if $__wcf->session->getPermission('admin.system.package.canUninstallPackage') && $package->package != 'com.woltlab.wcf' && $package->packageID != PACKAGE_ID} - + {else} {/if} diff --git a/wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php b/wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php index 460a9cebf5..7c1f358086 100755 --- a/wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php +++ b/wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php @@ -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(); -- 2.20.1