Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
When using download_form, passing query parameters through the action…
Browse files Browse the repository at this point in the history
… attribute does not work in IE or FF.
  • Loading branch information
cdujeu committed Jun 14, 2014
1 parent 6397bed commit a266359
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/src/plugins/access.fs/fsActions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,18 @@
downloadUrl = userSelection.updateFormOrUrl(null,downloadUrl);
document.location.href=downloadUrl;
}else{
var regex = new RegExp('.*?[&\\?]' + 'minisite_session' + '=(.*?)&.*');
val = window.ajxpServerAccessPath.replace(regex, "$1");
minisite_session = ( val == window.ajxpServerAccessPath ? false : val );
$('download_form').action = window.ajxpServerAccessPath;
$('download_form').secure_token.value = Connexion.SECURE_TOKEN;
$('download_form').select("input").each(function(input){
if(input.name!='get_action' && input.name!='secure_token') input.remove();
});
if(minisite_session){
$('download_form').insert(new Element('input', {type:'hidden', name:'minisite_session', value:minisite_session}));
}
userSelection.updateFormOrUrl($('download_form'));
try{
$('download_form').submit();
Expand Down
5 changes: 5 additions & 0 deletions core/src/plugins/action.powerfs/class.PowerFSController.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ public function switchAction($action, $httpVars, $fileVars)
} else {
$archiveName = $httpVars["archive_name"];
$jsCode = "
var regex = new RegExp('.*?[&\\?]' + 'minisite_session' + '=(.*?)&.*');
val = window.ajxpServerAccessPath.replace(regex, \"\$1\");
minisite_session = ( val == window.ajxpServerAccessPath ? false : val );
$('download_form').action = window.ajxpServerAccessPath;
$('download_form').secure_token.value = window.Connexion.SECURE_TOKEN;
$('download_form').select('input').each(function(input){
Expand All @@ -81,6 +85,7 @@ public function switchAction($action, $httpVars, $fileVars)
$('download_form').insert(new Element('input', {type:'hidden', name:'ope_id', value:'".$httpVars["ope_id"]."'}));
$('download_form').insert(new Element('input', {type:'hidden', name:'archive_name', value:'".$archiveName."'}));
$('download_form').insert(new Element('input', {type:'hidden', name:'get_action', value:'postcompress_download'}));
if(minisite_session) $('download_form').insert(new Element('input', {type:'hidden', name:'minisite_session', value:minisite_session}));
$('download_form').submit();
$('download_form').get_action.value = 'download';
";
Expand Down
7 changes: 7 additions & 0 deletions core/src/plugins/action.powerfs/manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,19 @@
conn.sendAsync();
}else{
var regex = new RegExp('.*?[&\\?]' + 'minisite_session' + '=(.*?)&.*');
val = window.ajxpServerAccessPath.replace(regex, "$1");
minisite_session = ( val == window.ajxpServerAccessPath ? false : val );
$('download_form').action = window.ajxpServerAccessPath;
$('download_form').secure_token.value = Connexion.SECURE_TOKEN;
$('download_form').select("input").each(function(input){
if(input.name!='get_action' && input.name!='secure_token') input.remove();
if(input.name=='get_action') input.value = 'download';
});
if(minisite_session){
$('download_form').insert(new Element('input', {type:'hidden', name:'minisite_session', value:minisite_session}));
}
userSelection.updateFormOrUrl($('download_form'));
$('download_form').submit();
}
Expand Down

0 comments on commit a266359

Please sign in to comment.