From 56786018ee0e74cac78b135731bf161e7e8e4a43 Mon Sep 17 00:00:00 2001 From: LouisGac Date: Tue, 21 Feb 2017 11:25:08 +0100 Subject: [PATCH] Dev: added param for Current language code --- application/helpers/SurveyRuntimeHelper.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/application/helpers/SurveyRuntimeHelper.php b/application/helpers/SurveyRuntimeHelper.php index d63c8f053a5..9c2deaea6f7 100644 --- a/application/helpers/SurveyRuntimeHelper.php +++ b/application/helpers/SurveyRuntimeHelper.php @@ -46,6 +46,7 @@ class SurveyRuntimeHelper { private $totalquestions; // Number of question in the survey. Same, should be moved to survey model. private $bTokenAnswerPersitance; // Are token used? Same... private $assessments; // Is assement used? Same... + private $sLangCode; // Current language code // moves private $moveResult = null; // Contains the result of LimeExpressionManager::JumpTo() OR LimeExpressionManager::NavigateBackwards() OR NavigateForwards::LimeExpressionManager(). TODO: create a function LimeExpressionManager::MoveTo that call the right method @@ -108,24 +109,17 @@ public function run($surveyid,$args) $previewgrp = $this->previewgrp = ($surveyMode == 'group' && isset($param['action']) && ($param['action'] == 'previewgroup')) ? true : false; $previewquestion = $this->previewquestion = ($surveyMode == 'question' && isset($param['action']) && ($param['action'] == 'previewquestion')) ? true : false; $preview = $this->preview = ($previewquestion || $previewgrp); + $sLangCode = $this->sLangCode = App()->language; $show_empty_group = $this->show_empty_group; + $this->setJavascriptVar($surveyid); $this->setArgs(); $aPrivateVariables = array(); - - - // SOME RENDERING THAT WAS IN THE WRONG PLACE INSIDE RUN PAGE - // WE'RE MOVING THEM HERE AS A FIRST CYCLE OF DEV - - - - $LEMsessid = $this->LEMsessid; - // language changer - $sLangCode = App()->language; + $thissurvey['alanguageChanger']['show'] = false; $alanguageChangerDatas = getLanguageChangerDatas($sLangCode); if ($alanguageChangerDatas){ @@ -136,7 +130,6 @@ public function run($surveyid,$args) // First time the survey is loaded if (!isset($_SESSION[$LEMsessid]['step'])){ - // WAS INSIDE buildsurveysession($surveyid); $this->showTokenOrCaptchaFormsIfNeeded(); }