From 97f28da5bcde29a55334741887fee649121a52ea Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Thu, 8 Aug 2013 12:40:06 +0200 Subject: [PATCH] Fixes multiple issues with initial ACL options --- .../templates/aclPermissionJavaScript.tpl | 95 ++++++++++++------- .../acp/templates/aclPermissionJavaScript.tpl | 95 ++++++++++++------- wcfsetup/install/files/js/WCF.ACL.js | 21 ++-- 3 files changed, 140 insertions(+), 71 deletions(-) diff --git a/com.woltlab.wcf/templates/aclPermissionJavaScript.tpl b/com.woltlab.wcf/templates/aclPermissionJavaScript.tpl index 8ad5b55c53..756e38df73 100644 --- a/com.woltlab.wcf/templates/aclPermissionJavaScript.tpl +++ b/com.woltlab.wcf/templates/aclPermissionJavaScript.tpl @@ -1,3 +1,6 @@ +{if $categoryName|isset && $categoryName|substr:-2 == '.*'} + {assign var='__categoryNameStart' value=$categoryName|substr:0:-1} +{/if} \ No newline at end of file + diff --git a/wcfsetup/install/files/acp/templates/aclPermissionJavaScript.tpl b/wcfsetup/install/files/acp/templates/aclPermissionJavaScript.tpl index 8ad5b55c53..756e38df73 100644 --- a/wcfsetup/install/files/acp/templates/aclPermissionJavaScript.tpl +++ b/wcfsetup/install/files/acp/templates/aclPermissionJavaScript.tpl @@ -1,3 +1,6 @@ +{if $categoryName|isset && $categoryName|substr:-2 == '.*'} + {assign var='__categoryNameStart' value=$categoryName|substr:0:-1} +{/if} \ No newline at end of file + diff --git a/wcfsetup/install/files/js/WCF.ACL.js b/wcfsetup/install/files/js/WCF.ACL.js index fc6d89d4f7..ece0440a79 100644 --- a/wcfsetup/install/files/js/WCF.ACL.js +++ b/wcfsetup/install/files/js/WCF.ACL.js @@ -1,7 +1,7 @@ /** * Namespace for ACL */ -WCF.ACL = {}; +WCF.ACL = { }; /** * ACL support for WCF @@ -84,6 +84,10 @@ WCF.ACL.List = Class.extend({ if (includeUserGroups === undefined) { includeUserGroups = true; } + this._values = { + group: { }, + user: { } + }; this._proxy = new WCF.Action.Proxy({ showLoadingOverlay: false, @@ -422,13 +426,13 @@ WCF.ACL.List = Class.extend({ }); if ($type == 'deny') { if (this._containerElements.denyAll !== null) { - if ($allChecked) this._containerElements.denyAll.prop('checked', true) + if ($allChecked) this._containerElements.denyAll.prop('checked', true); else this._containerElements.denyAll.prop('checked', false); } } else { if (this._containerElements.grantAll !== null) { - if ($allChecked) this._containerElements.grantAll.prop('checked', true) + if ($allChecked) this._containerElements.grantAll.prop('checked', true); else this._containerElements.grantAll.prop('checked', false); } } @@ -525,9 +529,16 @@ WCF.ACL.List = Class.extend({ _savePermissions: function() { // get active object var $activeObject = this._containerElements.aclList.find('li.active'); + if (!$activeObject.length) { + return; + } + var $objectID = $activeObject.data('objectID'); var $type = $activeObject.data('type'); + // clear old values + this._values[$type][$objectID] = { }; + var self = this; this._containerElements.permissionList.find("input[type='checkbox']").each(function(index, checkbox) { var $checkbox = $(checkbox); @@ -536,10 +547,6 @@ WCF.ACL.List = Class.extend({ var $optionID = $checkbox.data('optionID'); if ($checkbox.is(':checked')) { - if (!self._values[$type][$objectID]) { - self._values[$type][$objectID] = { }; - } - // store value self._values[$type][$objectID][$optionID] = $optionValue; -- 2.20.1