Skip to content

Commit

Permalink
Dev: Fix PHP echo in JS
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Dec 1, 2017
1 parent b511ee3 commit c5bac97
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 17 deletions.
2 changes: 2 additions & 0 deletions application/models/TemplateConfig.php
Expand Up @@ -899,6 +899,8 @@ public static function formatToJsonArray($oFiled)
$jFiled = json_encode($oFiled);
}

var_dump($jFiled);

return $jFiled;
}

Expand Down
46 changes: 29 additions & 17 deletions application/views/admin/survey/subview/_create_survey_text.php
@@ -1,27 +1,39 @@
<?php

/**
* General container for create survey action
* General container for create survey action
* @var AdminController $this
* @var Survey $oSurvey
*/
?>
*/

$standardthemerooturl = Yii::app()->getConfig('standardthemerooturl');
$templaterooturl = Yii::app()->getConfig('userthemerooturl');
$sAdminEmailAddressNeeded = gT("If you are using token functions or notifications emails you need to set an administrator email address.");

<?php App()->getClientScript()->registerScript("createSurveyText-variables", "
var standardthemerooturl = '<?php echo Yii::app()->getConfig('standardthemerooturl');?>';
var templaterooturl = '<?php echo Yii::app()->getConfig('userthemerooturl');?>';
var jsonUrl = '';
var sAction = '';
var sParameter = '';
var sTargetQuestion = '';
var sNoParametersDefined = '';
var sAdminEmailAddressNeeded = '".gT("If you are using token functions or notifications emails you need to set an administrator email address.")."'
var sURLParameters = '';
var sAddParam = '';
", LSYii_ClientScript::POS_BEGIN);
App()->getClientScript()->registerScript(
"createSurveyText-variables",
sprintf(
"var standardthemerooturl = '%s';
var templaterooturl = '%s';
var jsonUrl = '';
var sAction = '';
var sParameter = '';
var sTargetQuestion = '';
var sNoParametersDefined = '';
var sAdminEmailAddressNeeded = '%s'
var sURLParameters = '';
var sAddParam = '';",
$standardthemerooturl,
$templaterooturl,
$sAdminEmailAddressNeeded
),
LSYii_ClientScript::POS_BEGIN
);

$count = 0;
if(isset($scripts))
echo $scripts;
if (isset($scripts)) {
echo $scripts;
}

$aSurveyLanguageSettings = $aTabContents['aSurveyLanguageSettings'];
$surveyid = $aTabContents['surveyid'];
Expand Down

0 comments on commit c5bac97

Please sign in to comment.