From b270615c18401cab859a5f065b1d7e8e80a6d578 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 12 May 2009 04:49:25 +0000 Subject: [PATCH] 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 --- javascript/SideReports.js | 4 +++- javascript/SideTabs.js | 13 ++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/javascript/SideReports.js b/javascript/SideReports.js index 3d3fed93..a16af4c6 100755 --- a/javascript/SideReports.js +++ b/javascript/SideReports.js @@ -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; } } diff --git a/javascript/SideTabs.js b/javascript/SideTabs.js index e4a66dae..d853c008 100755 --- a/javascript/SideTabs.js +++ b/javascript/SideTabs.js @@ -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(); }