Skip to content

Commit

Permalink
Fixed issue #9488: Radix separator is allways set to the base languag…
Browse files Browse the repository at this point in the history
…e in javascript

Dev: use App()->getLanguage() from Yii::app()
  • Loading branch information
Shnoulle committed Feb 3, 2015
1 parent f64bd81 commit fad0653
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -177,14 +177,8 @@ function run($surveyid,$args) {
$thissurvey = getSurveyInfo($surveyid);
}
$LEMsessid = 'survey_' . $surveyid;
if (isset($_SESSION[$LEMsessid]['s_lang']))
{
$this->setJavascriptVar($surveyid, $_SESSION[$LEMsessid]['s_lang']);
}
else
{
$this->setJavascriptVar($surveyid, $thissurvey['language']);
}
$this->setJavascriptVar($surveyid);

$sTemplatePath=getTemplatePath(Yii::app()->getConfig("defaulttemplate")).DIRECTORY_SEPARATOR;
if (isset ($_SESSION['survey_'.$surveyid]['templatepath']))
{
Expand Down Expand Up @@ -1196,14 +1190,12 @@ function run($surveyid,$args) {
/**
* setJavascriptVar
*
*
* @return @void
* @param integer $iSurveyId : the survey id for the script
* @param string $sLanguage : the actual language for the survey
*/
public function setJavascriptVar($iSurveyId, $sLanguage)
public function setJavascriptVar($iSurveyId)
{
$aSurveyinfo=getSurveyInfo($iSurveyId);
$aSurveyinfo=getSurveyInfo($iSurveyId, App()->getLanguage());
if(isset($aSurveyinfo['surveyls_numberformat']))
{
$aLSJavascriptVar=array();
Expand All @@ -1214,6 +1206,6 @@ public function setJavascriptVar($iSurveyId, $sLanguage)
$sLSJavascriptVar="LSvar=".json_encode($aLSJavascriptVar) . ';';
App()->clientScript->registerScript('sLSJavascriptVar',$sLSJavascriptVar,CClientScript::POS_HEAD);
}
// Don't update, because already set in index/run
// Maybe remove one from index and allow empty $surveyid here.
}
}

0 comments on commit fad0653

Please sign in to comment.