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
This commit is contained in:
Ingo Schommer 2007-09-16 02:19:43 +00:00
parent 08974ae348
commit 0438c5006d

View File

@ -102,25 +102,26 @@ deletegroup = {
if(deletegroup.selectedNodes[idx]) csvIDs += (csvIDs ? "," : "") + idx; if(deletegroup.selectedNodes[idx]) csvIDs += (csvIDs ? "," : "") + idx;
} }
if(csvIDs) { if(csvIDs) {
$('deletegroup_options').elements.csvIDs.value = csvIDs; if(confirm("Do you really want to these groups?")) {
$('deletegroup_options').elements.csvIDs.value = csvIDs;
Ajax.SubmitForm('deletegroup_options', null, {
onSuccess : function(response) { Ajax.SubmitForm('deletegroup_options', null, {
Ajax.Evaluator(response); onSuccess : function(response) {
Ajax.Evaluator(response);
var sel;
if((sel = $('sitetree').firstSelected()) && sel.parentNode) sel.addNodeClass('current'); var sel;
else $('Form_EditForm').innerHTML = ""; if((sel = $('sitetree').firstSelected()) && sel.parentNode) sel.addNodeClass('current');
else $('Form_EditForm').innerHTML = "";
treeactions.closeSelection($('deletegroup'));
}, treeactions.closeSelection($('deletegroup'));
onFailure : function(response) { },
errorMessage('Error deleting pages', response); onFailure : function(response) {
} errorMessage('Error deleting pages', response);
}); }
});
$('deletegroup').getElementsByTagName('button')[0].onclick();
$('deletegroup').getElementsByTagName('button')[0].onclick();
}
} else { } else {
alert("Please select at least 1 security group."); alert("Please select at least 1 security group.");
} }