From 0438c5006dfefce5e95b17516ee5e3bca18d3a60 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sun, 16 Sep 2007 02:19:43 +0000 Subject: [PATCH] elofgren: Added delete confirmation for items in Security left tree. As part of fix for gsoc trac ticekt: #51 Warning is needed before items are deleted from security & newsletter tree (merged from branches/gsoc) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@42043 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/SecurityAdmin_left.js | 39 ++++++++++++++++---------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/javascript/SecurityAdmin_left.js b/javascript/SecurityAdmin_left.js index f5b5b7c4..cc006f75 100755 --- a/javascript/SecurityAdmin_left.js +++ b/javascript/SecurityAdmin_left.js @@ -102,25 +102,26 @@ deletegroup = { if(deletegroup.selectedNodes[idx]) csvIDs += (csvIDs ? "," : "") + idx; } if(csvIDs) { - $('deletegroup_options').elements.csvIDs.value = csvIDs; - - Ajax.SubmitForm('deletegroup_options', null, { - onSuccess : function(response) { - Ajax.Evaluator(response); - - var sel; - if((sel = $('sitetree').firstSelected()) && sel.parentNode) sel.addNodeClass('current'); - else $('Form_EditForm').innerHTML = ""; - - treeactions.closeSelection($('deletegroup')); - }, - onFailure : function(response) { - errorMessage('Error deleting pages', response); - } - }); - - $('deletegroup').getElementsByTagName('button')[0].onclick(); - + if(confirm("Do you really want to these groups?")) { + $('deletegroup_options').elements.csvIDs.value = csvIDs; + + Ajax.SubmitForm('deletegroup_options', null, { + onSuccess : function(response) { + Ajax.Evaluator(response); + + var sel; + if((sel = $('sitetree').firstSelected()) && sel.parentNode) sel.addNodeClass('current'); + else $('Form_EditForm').innerHTML = ""; + + treeactions.closeSelection($('deletegroup')); + }, + onFailure : function(response) { + errorMessage('Error deleting pages', response); + } + }); + + $('deletegroup').getElementsByTagName('button')[0].onclick(); + } } else { alert("Please select at least 1 security group."); }