diff --git a/application/helpers/SurveyRuntimeHelper.php b/application/helpers/SurveyRuntimeHelper.php index 80716037495..d497303f329 100644 --- a/application/helpers/SurveyRuntimeHelper.php +++ b/application/helpers/SurveyRuntimeHelper.php @@ -483,7 +483,7 @@ public function run($surveyid,$args) $thissurvey['aLEM']['debugvalidation']['message'] = $moveResult['message']; } - echo Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($sTemplateViewPath."layout_main.twig"), array('aSurveyInfo'=>$thissurvey), false); + Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($sTemplateViewPath."layout_main.twig"), array('aSurveyInfo'=>$thissurvey), false); } @@ -1077,8 +1077,7 @@ private function saveAllIfNeeded() $cSave = new Save(); // $cSave->showsaveform($thissurvey['sid']); // generates a form and exits, awaiting input $thissurvey['aSaveForm'] = $cSave->getSaveFormDatas($thissurvey['sid']); - echo Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($sTemplateViewPath."layout_save.twig"), array('aSurveyInfo'=>$thissurvey), false); - Yii::app()->end(); + Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($sTemplateViewPath."layout_save.twig"), array('aSurveyInfo'=>$thissurvey), false); }else{ // Intentional retest of all conditions to be true, to make sure we do have tokens and surveyid // Now update lastpage to $_SESSION[$LEMsessid]['step'] in SurveyDynamic, otherwise we land on @@ -1122,8 +1121,7 @@ private function saveSubmitIfNeeded() // reshow the form if there is an error if (!empty($aResult['aSaveErrors'])){ $thissurvey['aSaveForm'] = $cSave->getSaveFormDatas($thissurvey['sid']); - echo Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($sTemplateViewPath."layout_save.twig"), array('aSurveyInfo'=>$thissurvey), false); - Yii::app()->end(); + Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($sTemplateViewPath."layout_save.twig"), array('aSurveyInfo'=>$thissurvey), false); } $moveResult = $this->moveResult = LimeExpressionManager::GetLastMoveResult(true); @@ -1194,8 +1192,7 @@ private function moveSubmitIfNeeded() $completed = templatereplace($thissurvey['surveyls_endtext'], array(), $redata, 'SubmitEndtextI', false, NULL, array(), true ); $this->completed = $completed; - echo Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($sTemplateViewPath."layout_submit_preview.twig"), array('aSurveyInfo'=>$thissurvey), false); - App()->end(); + Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($sTemplateViewPath."layout_submit_preview.twig"), array('aSurveyInfo'=>$thissurvey), false); }else{ //Update the token if needed and send a confirmation email @@ -1299,8 +1296,7 @@ private function moveSubmitIfNeeded() killSurveySession($surveyid); } - echo Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($sTemplateViewPath."layout_submit.twig"), array('aSurveyInfo'=>$thissurvey), false); - exit; + Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($sTemplateViewPath."layout_submit.twig"), array('aSurveyInfo'=>$thissurvey), false); } } @@ -1645,8 +1641,7 @@ private function manageClearAll() $thissurvey['surveyUrl'] = $restarturl; - echo Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($sTemplateViewPath."layout_clearall.twig"), array('aSurveyInfo'=>$thissurvey), false); - App()->end(); + Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($sTemplateViewPath."layout_clearall.twig"), array('aSurveyInfo'=>$thissurvey), false); } } diff --git a/application/helpers/frontend_helper.php b/application/helpers/frontend_helper.php index 1de536f4c74..5f0ea0164c9 100644 --- a/application/helpers/frontend_helper.php +++ b/application/helpers/frontend_helper.php @@ -1477,9 +1477,7 @@ function renderRenderWayForm($renderWay, array $scenarios, $sTemplateViewPath, $ $thissurvey["aForm"] = $aForm; $thissurvey['surveyUrl'] = App()->createUrl("/survey/index",array("sid"=>$surveyid)); - echo Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($sTemplateViewPath."layout_user_forms.twig"), array('aSurveyInfo'=>$thissurvey), false); - // With a good logic in survey runtime, we could avoid those exits - Yii::app()->end(); + Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($sTemplateViewPath."layout_user_forms.twig"), array('aSurveyInfo'=>$thissurvey), false); break; case "register": //Register new user @@ -1579,8 +1577,7 @@ function renderError($sTitle='', $sMessage, $thissurvey, $sTemplateViewPath ) $aError['message'] = $sMessage; $thissurvey['aError'] = $aError; - echo Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($sTemplateViewPath."layout_errors.twig"), array('aSurveyInfo'=>$thissurvey), false); - Yii::app()->end(); + Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($sTemplateViewPath."layout_errors.twig"), array('aSurveyInfo'=>$thissurvey), false); } @@ -2215,8 +2212,7 @@ function checkCompletedQuota($surveyid,$return=false) } } - echo Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($sTemplateViewPath."layout_quotas.twig"), array('aSurveyInfo'=>$thissurvey), false); - Yii::app()->end(); + Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($sTemplateViewPath."layout_quotas.twig"), array('aSurveyInfo'=>$thissurvey), false); } /** @@ -2321,7 +2317,7 @@ function display_first_page($thissurvey) { LimeExpressionManager::FinishProcessingPage(); $thissurvey['surveyUrl'] = Yii::app()->getController()->createUrl("survey/index",array("sid"=>$surveyid)); // For form action (will remove newtest) - echo Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($sTemplateViewPath."layout_first_page.twig"), array('aSurveyInfo'=>$thissurvey), false); + Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($sTemplateViewPath."layout_first_page.twig"), array('aSurveyInfo'=>$thissurvey), false); } /** diff --git a/templates/default/views/subviews/progess_bar.twig b/templates/default/views/subviews/progess_bar.twig index cfb8e8db66e..2115c6bdeec 100644 --- a/templates/default/views/subviews/progess_bar.twig +++ b/templates/default/views/subviews/progess_bar.twig @@ -21,7 +21,7 @@
{% if aSurveyInfo.format != 'A' and aSurveyInfo.showprogress is defined and aSurveyInfo.showprogress == 'Y' %} - {{ registerPublicCssFile('lime-progress.css') }} + {{ registerPublicCssFile('lime-progress.css') }} {% set progressValue = ( aSurveyInfo.progress.total > 0 ) ? intval( (aSurveyInfo.progress.currentstep - 1) / aSurveyInfo.progress.total * 100 ) : 0 %}