elofgren: Added delete confirmation for items in Newsletter 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@42040 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2007-09-16 02:18:18 +00:00
parent 706580c443
commit 6cb2df64dd

View File

@ -131,25 +131,26 @@ deletedraft = {
}
if(csvIDs) {
$('deletedrafts_options').elements.csvIDs.value = csvIDs;
Ajax.SubmitForm('deletedrafts_options', null, {
onSuccess : function(response) {
Ajax.Evaluator(response);
var sel;
if((sel = $('sitetree').selected) && sel.parentNode) sel.addNodeClass('current');
// else $('Form_EditForm').innerHTML = "";
treeactions.closeSelection($('deletedrafts'));
},
onFailure : function(response) {
errorMessage('Error deleting drafts', response);
}
});
$('deletedrafts').getElementsByTagName('button')[0].onclick();
if(confirm("Do you really want to these Newsletter items?")) {
$('deletedrafts_options').elements.csvIDs.value = csvIDs;
Ajax.SubmitForm('deletedrafts_options', null, {
onSuccess : function(response) {
Ajax.Evaluator(response);
var sel;
if((sel = $('sitetree').selected) && sel.parentNode) sel.addNodeClass('current');
// else $('Form_EditForm').innerHTML = "";
treeactions.closeSelection($('deletedrafts'));
},
onFailure : function(response) {
errorMessage('Error deleting drafts', response);
}
});
$('deletedrafts').getElementsByTagName('button')[0].onclick();
}
} else {
alert("Please select at least 1 page.");
}