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 {
|
|
|
|
var url = baseHref() + 'admin/' + this.name.substring(7) + '?ID=' + $('Form_EditForm_ID').value + '&newlang=' +
|
|
|
|
$('Form_EditForm_NewTransLang').value + '&ajax=1';
|
2009-05-12 04:28:18 +02:00
|
|
|
url += "&locale=" + $('Form_EditForm_Locale').value;
|
2010-11-01 02:29:02 +01:00
|
|
|
url += "&SecurityID=" + $$('input[name=SecurityID]')[0].value;
|
2007-09-16 18:30:26 +02:00
|
|
|
|
2012-11-21 13:33:47 +01:00
|
|
|
new Ajax.Request(url);
|
2007-09-16 18:30:26 +02:00
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|