Skip to content

Commit

Permalink
Fixed issue #5997 : upload windows are on default survey langage
Browse files Browse the repository at this point in the history
Dev : add 'File name' for translation
Dev : fixed a HTML issue with langagechanger
  • Loading branch information
Shnoulle committed Apr 11, 2012
1 parent 45e170a commit 60994d2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions index.php
Expand Up @@ -1128,8 +1128,8 @@ function makelanguagechanger()

// Changed how language changer works so that posts any currently set values. This also ensures that token (and other) parmeters are also posted.
// $htmlcode ="<select name=\"select\" class='languagechanger' onchange=\"javascript:window.location=this.value\">\n";
$htmlcode ="<select name=\"select\" class='languagechanger'"
. "onchange=\"javascript:$('[name=move]').val('changelang_'+ this.value);$('#limesurvey').submit();\">\n";
$htmlcode ="<select name=\"select\" class='languagechanger' "
. " onchange=\"javascript:$('[name=move]').val('changelang_'+ this.value);$('#limesurvey').submit();\">\n";

$sAddToURL = "";
$sTargetURL = "$relativeurl/index.php";
Expand Down
3 changes: 3 additions & 0 deletions qanda.php
Expand Up @@ -3066,6 +3066,9 @@ function do_file_upload($ia)
var translt = {
title: '" . $clang->gT('Upload your files','js') . "',
returnTxt: '" . $clang->gT('Return to survey','js') . "',
headTitle: '" . $clang->gT('Title','js') . "',
headComment: '" . $clang->gT('Comment','js') . "',
headFileName: '" . $clang->gT('File name','js') . "',
};
</script>\n";
/*if ($pos)
Expand Down
6 changes: 3 additions & 3 deletions scripts/modaldialog.js
Expand Up @@ -151,10 +151,10 @@ function displayUploadedFiles(jsonstring, filecount, fieldname, show_title, show
jsonobj = eval('(' + jsonstring + ')');
display = '<table width="100%"><tr><th align="center" width="20%">&nbsp;</th>';
if (show_title != 0)
display += '<th align="center"><b>Title</b></th>';
display += '<th align="center"><b>'+translt.headTitle+'</b></th>';
if (show_comment != 0)
display += '<th align="center"><b>Comment</b></th>';
display += '<th align="center"><b>Name</b></th></tr>';
display += '<th align="center"><b>'+translt.headComment+'</b></th>';
display += '<th align="center"><b>'+translt.headFileName+'</b></th></tr>';
var image_extensions = new Array('gif', 'jpeg', 'jpg', 'png', 'swf', 'psd', 'bmp', 'tiff', 'jp2', 'iff', 'bmp', 'xbm', 'ico');

for (i = 0; i < filecount; i++)
Expand Down
10 changes: 9 additions & 1 deletion uploader.php
Expand Up @@ -52,6 +52,15 @@
{
die("You don't have a valid session !");
}
if (isset($_SESSION['s_lang']))
{
$clang = SetSurveyLanguage( $surveyid, $_SESSION['s_lang']);
}
elseif (isset($surveyid) && $surveyid)
{
$baselang = GetBaseLanguageFromSurveyID($surveyid);
$clang = SetSurveyLanguage( $surveyid, $baselang);
}
if (isset($_GET['filegetcontents']))
{
$sFileName=sanitize_filename($_GET['filegetcontents']);
Expand Down Expand Up @@ -131,4 +140,3 @@
</body>
</html>';
echo $body;
?>

0 comments on commit 60994d2

Please sign in to comment.