Skip to content

Commit

Permalink
Merge branch 'master' into 192_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
TMSWhite committed Apr 8, 2012
2 parents 4b39135 + 1bb18a2 commit fda57a3
Show file tree
Hide file tree
Showing 17 changed files with 28,327 additions and 27,126 deletions.
2 changes: 1 addition & 1 deletion admin/browse.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
//SHOW INDIVIDUAL RECORD
$idquery = "SELECT * FROM {$surveytable} s";
if ($surveyinfo['anonymized'] == "N" && db_tables_exist($tokentable))
$idquery .= "LEFT JOIN {$tokentable} t ON s.token = t.token ";
$idquery .= " LEFT JOIN {$tokentable} t ON s.token = t.token ";
if (incompleteAnsFilterstate() == "inc")
$idquery .= " WHERE (submitdate = ".$connect->DBDate('1980-01-01'). " OR submitdate IS NULL) AND ";
elseif (incompleteAnsFilterstate() == "filter")
Expand Down
2 changes: 1 addition & 1 deletion admin/conditionshandling.php
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@
{
foreach($canswers as $can)
{
$an=json_encode(FlattenText($can[2]));
$an=ls_json_encode(FlattenText($can[2]));
$conditionsoutput_main_content .= "Fieldnames[$jn]='$can[0]';\n"
."Codes[$jn]='$can[1]';\n"
."Answers[$jn]={$an};\n";
Expand Down
2 changes: 1 addition & 1 deletion admin/dataentry.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
}

$columns[] .= db_quote_id($fieldname);
$values[] .= db_quoteall(json_encode($phparray), true);
$values[] .= db_quoteall(ls_json_encode($phparray), true);
}
else
{
Expand Down
6 changes: 3 additions & 3 deletions admin/questionhandling.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@
$qCodeToInfo = 'qCodeToInfo = {';
foreach ($qtypelist as $qtype=>$qdesc){
$qDescToCode .= " '{$qdesc['description']}' : '{$qtype}', \n";
$qCodeToInfo .= " '{$qtype}' : '".json_encode($qdesc)."', \n";
$qCodeToInfo .= " '{$qtype}' : '".ls_json_encode($qdesc)."', \n";
}
$qTypeOutput = "$qDescToCode 'null':'null' }; \n $qCodeToInfo 'null':'null' };";

Expand Down Expand Up @@ -924,7 +924,7 @@ function questionjavascript($type)
$labels=$connect->GetArray($query);
$resultdata[]=array($language=>array($labels,getLanguageNameFromCode($language,false)));
}
echo json_encode($resultdata);
echo ls_json_encode($resultdata);
}


Expand All @@ -941,7 +941,7 @@ function questionjavascript($type)
$language=null;
}
$resultdata=getlabelsets($language);
echo json_encode($resultdata);
echo ls_json_encode($resultdata);
}


Expand Down
4 changes: 2 additions & 2 deletions admin/surveylist.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
while($rows = $result->FetchRow())
$aUsers['newowner'] = $rows['users_name'];
}
$ajaxoutput = json_encode($aUsers) . "\n";
$ajaxoutput = ls_json_encode($aUsers) . "\n";

}

Expand All @@ -260,6 +260,6 @@
$aUsers[] = array($userline['uid'], $userline['user']);
}

$ajaxoutput = json_encode($aUsers) . "\n";
$ajaxoutput = ls_json_encode($aUsers) . "\n";
}

2 changes: 1 addition & 1 deletion admin/translate_google_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@

}

$ajaxoutput = json_encode($aOutput). "\n";
$ajaxoutput = ls_json_encode($aOutput). "\n";
2 changes: 1 addition & 1 deletion classes/expressions/LimeExpressionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -6097,7 +6097,7 @@ static function ProcessCurrentResponses()
$phparray[$i]->filename = $sDestinationFileName;
}
}
$value = str_replace('{','{ ',json_encode($phparray)); // so that EM doesn't try to parse it.
$value = ls_json_encode($phparray); // so that EM doesn't try to parse it.
}
}
break;
Expand Down
11 changes: 11 additions & 0 deletions common_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7240,5 +7240,16 @@ function fixSubquestions()

}

/**
* Need custom version of JSON encode to avoid having Expression Manager mangle it
* @param type $val
* @return type
*/
function ls_json_encode($val)
{
$ans = json_encode($val);
$ans = str_replace(array('{','}'),array('{ ',' }'), $ans);
return $ans;
}

// Closing PHP tag intentionally omitted - yes, it is okay
2 changes: 1 addition & 1 deletion delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
$iFileIndex++;
}
if ($found==true) unset($aFiles[$iFileIndex]);
$_SESSION[$sFieldname] = str_replace('{','{ ',json_encode($aFiles));
$_SESSION[$sFieldname] = ls_json_encode($aFiles);
}

if (@unlink($sFileDir.$sFilename))
Expand Down
Binary file modified locale/de-informal/LC_MESSAGES/de-informal.mo
Binary file not shown.

0 comments on commit fda57a3

Please sign in to comment.