Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
smartinkc committed May 6, 2020
2 parents 25e2af4 + 311ab5c commit 6cbc493
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
24 changes: 19 additions & 5 deletions js/multilingual_survey.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,12 +630,16 @@ var Multilingual = (function(){
for(id2 in translations['answers'][id]['text']){
$('.ec').each(function(){
var tmp = $(this).parent().attr('comps').split(',');
$(this).show();
if($(this).parent().parent().hasClass('enhancedchoice')) {
$(this).parent().show();
}
if(tmp[0] == id && tmp[2] == id2) {
$(this).html(' ' + translations['answers'][id]['text'][id2]);
$(this).data('lang', lang);
} else if(settings['hide-answers-without-translation-survey'] && settings['hide-answers-without-translation-survey']['value'] && $(this).data('lang') !== lang) {
$(this).hide();
if($(this).parent().parent().hasClass('enhancedchoice')) {
$(this).parent().hide();
}
}
});
}
Expand All @@ -644,7 +648,10 @@ var Multilingual = (function(){
var id2;
for(id2 in translations['answers'][id]['text']){
$('#'+id+'-tr .choicevert').each(function(){
//$(this).show();
if(!$(this).hasClass('hidden')) {
$(this).show();
}

if($(this).find('[name="__chk__' + id + '_RC_' + id2 + '"]').length) {
$(this).contents().last().html(' ' + translations['answers'][id]['text'][id2]);
$(this).data('lang', lang);
Expand All @@ -657,12 +664,19 @@ var Multilingual = (function(){
for(id2 in translations['answers'][id]['text']){
$('.ec').each(function(){
var tmp = $(this).parent().attr('comps').split(',');
//$(this).show();

if($(this).parent().parent().hasClass('enhancedchoice')) {
$(this).parent().show();
}
// console.log($(this).parent());

if(tmp[0] == id && tmp[2] == id2) {
$(this).html(translations['answers'][id]['text'][id2]);
$(this).data('lang', lang);
} else if(settings['hide-answers-without-translation-survey'] && settings['hide-answers-without-translation-survey']['value'] && $(this).data('lang') !== lang) {
$(this).hide();
if($(this).parent().parent().hasClass('enhancedchoice')) {
$(this).parent().hide();
}
}
});
}
Expand Down
3 changes: 1 addition & 2 deletions multilingualPDF.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ function getName($n) {

//save metadata to file
file_put_contents(APP_PATH_DOCROOT."PDF".DS."$random.json", json_encode($metadata));
chmod(775, APP_PATH_DOCROOT."PDF".DS."$random.php");

//split up PDF/index.php file and add details
$pdfFile = file_get_contents(APP_PATH_DOCROOT."PDF".DS."index.php");
Expand Down Expand Up @@ -123,4 +122,4 @@ function getName($n) {
chmod(775, APP_PATH_DOCROOT."PDF".DS."index_multilingual_$random.php");

header('Location:' . APP_PATH_WEBROOT . "PDF" . DS . "index_multilingual_$random.php?pid=" . $_GET['pid'] . (isset($_GET['form']) ? "&page=" . $_GET['form'] : '') . "&id=" . $_GET['id'] . (isset($_GET['event_id']) ? "&event_id=" . $_GET['event_id'] : '') . (isset($_GET['instance']) && $_GET['instance'] > 1 ? "&instance=" . $_GET['instance'] : ''));
?>
?>

0 comments on commit 6cbc493

Please sign in to comment.