Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
Conflicts:
	application/controllers/admin/questions.php
  • Loading branch information
olleharstedt committed May 17, 2018
2 parents 249d5ce + c92ca48 commit c51c8eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions application/controllers/admin/questions.php
Expand Up @@ -1005,6 +1005,9 @@ public function newquestion($surveyid)
}
$aData['oQuestion'] = $oQuestion;
$aData['groupid'] = $oQuestion->gid;
$qid = null;
$aData['aQuestionTemplateAttributes'] = Question::model()->getAdvancedSettingsWithValues($qid, $eqrow['type'], $surveyid)['question_template'];
$aData['aQuestionTemplateList'] = \QuestionTemplate::getQuestionTemplateList($eqrow['type']);

$sumresult1 = $survey;
if (is_null($sumresult1)) {
Expand Down
5 changes: 5 additions & 0 deletions application/core/LSETwigViewRenderer.php
Expand Up @@ -154,6 +154,11 @@ public function renderQuestion($sView, $aData)
if (file_exists($requiredView.'.twig')) {
// We're not using the Yii Theming system, so we don't use parent::renderFile
// current controller properties will be accessible as {{ this.property }}

// aData and surveyInfo variables are accessible from question type twig files
$aData['aData'] = $aData;
$sBaseLanguage = Survey::model()->findByPk($_SESSION['LEMsid'])->language;
$aData['surveyInfo'] = getSurveyInfo($_SESSION['LEMsid'], $sBaseLanguage);
$aData['this'] = Yii::app()->getController();
$aData['question_template_attribute'] = $oQuestionTemplate->getCustomAttributes();
$template = $this->_twig->loadTemplate($sView.'.twig')->render($aData);
Expand Down

0 comments on commit c51c8eb

Please sign in to comment.