2007-09-16 18:30:26 +02:00
|
|
|
Behaviour.register({
|
2009-03-18 18:14:02 +01:00
|
|
|
'input#Form_EditForm_createtranslation': {
|
|
|
|
onclick: function(e) {
|
2007-09-16 18:30:26 +02:00
|
|
|
var st = $('sitetree');
|
|
|
|
var originalID = st.getIdxOf(st.firstSelected());
|
|
|
|
if(originalID && originalID.substr(0,3) == 'new') {
|
|
|
|
alert("You have to save a page before translating it");
|
|
|
|
} else {
|
2009-11-21 03:37:51 +01:00
|
|
|
var url = jQuery('base').attr('href') + 'admin/' + this.name.substring(7) + '?ID=' + $('Form_EditForm_ID').value + '&newlang=' +
|
2007-09-16 18:30:26 +02:00
|
|
|
$('Form_EditForm_NewTransLang').value + '&ajax=1';
|
2009-05-12 04:28:18 +02:00
|
|
|
url += "&locale=" + $('Form_EditForm_Locale').value;
|
2007-09-16 18:30:26 +02:00
|
|
|
|
|
|
|
new Ajax.Request( url, {
|
|
|
|
onSuccess: Ajax.Evaluator,
|
|
|
|
onFailure: Ajax.Evaluator
|
|
|
|
});
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|