removes legacy disable user menu item and uses the new/normal way of dealing with menu items.

This commit is contained in:
Shannon
2016-03-31 19:41:42 +02:00
parent c6a586274e
commit 1b8747bd6d
7 changed files with 33 additions and 129 deletions

View File

@@ -190,20 +190,6 @@ Umbraco.Sys.registerNamespace("Umbraco.Application");
var actions = {
openDashboard : function(section){
navService.changeSection(section);
},
actionDisable: function () {
localizationService.localize("defaultdialogs_confirmdisable").then(function (txtConfirmDisable) {
var currentMenuNode = UmbClientMgr.mainTree().getActionNode();
if (currentMenuNode) {
if (confirm(txtConfirmDisable + ' "' + UmbClientMgr.mainTree().getActionNode().nodeName + '"?\n\n')) {
angularHelper.safeApply($rootScope, function () {
userResource.disableUser(currentMenuNode.nodeId).then(function () {
UmbClientMgr.mainTree().syncTree("-1," + currentMenuNode.nodeId, true);
});
});
}
}
});
}
};

View File

@@ -8,10 +8,21 @@
* @description
* Defines the methods that are called when menu items declare only an action to execute
*/
function umbracoMenuActions($q, treeService, $location, navigationService, appState) {
function umbracoMenuActions($q, treeService, $location, navigationService, appState, localizationService, userResource) {
return {
"DisableUser": function(args) {
localizationService.localize("defaultdialogs_confirmdisable").then(function (txtConfirmDisable) {
var currentMenuNode = UmbClientMgr.mainTree().getActionNode();
if (confirm(txtConfirmDisable + ' "' + args.entity.name + '"?\n\n')) {
userResource.disableUser(args.entity.id).then(function () {
navigationService.syncTree({ tree: args.treeAlias, path: [args.entity.parentId, args.entity.id], forceReload: true });
});
}
});
},
/**
* @ngdoc method
* @name umbraco.services.umbracoMenuActions#RefreshNode