BUGFIX Made SideTabs and SideReports work with Translatable by explicitly passing a "locale" GET parameter (see #4014)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@76650 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-05-12 04:49:25 +00:00
parent b0bbadc665
commit b270615c18
2 changed files with 13 additions and 4 deletions

View File

@ -32,7 +32,9 @@ SideReports.prototype = {
SideReportRecord.applyTo('#' + this.id + ' a');
},
ajaxURL: function() {
return 'admin/sidereport/' + this.selector.value;
var url = 'admin/sidereport/' + this.selector.value;
if($('LangSelector')) url += "?locale=" + $('LangSelector').value;
return url;
}
}

View File

@ -213,8 +213,11 @@ SidePanel.prototype = {
var srcName = this.id.replace('_holder','');
var id = $('Form_EditForm').elements.ID;
if(id) id = id.value; else id = "";
// This assumes that admin/cms/ refers to CMSMain
return 'admin/cms/' + srcName + '/' + id + '?ajax=1';
var url = 'admin/cms/' + srcName + '/' + id + '?ajax=1';
if($('Form_EditForm_Locale')) url += "&locale=" + $('Form_EditForm_Locale').value;
return url;
},
afterPanelLoaded : function() {
@ -303,7 +306,9 @@ VersionList.prototype = {
select : function(pageID, versionID, sourceEl) {
if(this.mode == 'view') {
sourceEl.select();
$('Form_EditForm').loadURLFromServer('admin/getversion/' + pageID + '/' + versionID);
var url = 'admin/getversion/' + pageID + '/' + versionID;
if($('Form_EditForm_Locale')) url += "?locale=" + $('Form_EditForm_Locale').value;
$('Form_EditForm').loadURLFromServer(url);
$('viewArchivedSite').style.display = '';
$('viewArchivedSite').getVars = '?archiveDate=' + sourceEl.getElementsByTagName('td')[1].className;
@ -314,7 +319,9 @@ VersionList.prototype = {
sourceEl.select();
this.otherSourceEl.select(true);
statusMessage('Loading comparison...');
$('Form_EditForm').loadURLFromServer('admin/compareversions/' + pageID + '/?From=' + this.otherVersionID + '&To=' + versionID);
var url = 'admin/compareversions/' + pageID + '/?From=' + this.otherVersionID + '&To=' + versionID;
if($('Form_EditForm_Locale')) url += "&locale=" + $('Form_EditForm_Locale').value;
$('Form_EditForm').loadURLFromServer(url);
} else {
sourceEl.select();
}