Skip to content

Commit

Permalink
Dev: added surveylanguage as a variable for twig
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Dec 16, 2016
1 parent b04c11b commit 443aded
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/helpers/replacements_helper.php
Expand Up @@ -587,7 +587,7 @@ function templatereplace($line, $replacements = array(), &$redata = array(), $de
$coreReplacements['SURVEYCONTACT'] = $surveycontact;
$coreReplacements['SURVEYDESCRIPTION'] = (isset($thissurvey['description']) ? $thissurvey['description'] : '');
$coreReplacements['SURVEYFORMAT'] = isset($surveyformat) ? $surveyformat : ''; // global
$coreReplacements['SURVEYLANGUAGE'] = App()->language;
$coreReplacements['SURVEYLANGUAGE'] = $surveylanguage = App()->language;
$coreReplacements['SURVEYNAME'] = (isset($thissurvey['name']) ? $thissurvey['name'] : Yii::app()->getConfig('sitename'));
$coreReplacements['SURVEYRESOURCESURL'] = (isset($thissurvey['sid']) ? Yii::app()->getConfig("uploadurl").'/surveys/'.$thissurvey['sid'].'/' : '');
$coreReplacements['TEMPLATECSS'] = $_templatecss;
Expand All @@ -611,7 +611,7 @@ function templatereplace($line, $replacements = array(), &$redata = array(), $de
{
$doTheseReplacements = $coreReplacements;
}

$redata = compact(array_keys(get_defined_vars()));
$line = Yii::app()->twigRenderer->renderTemplateFromString( $line, $redata, false);

Expand Down

0 comments on commit 443aded

Please sign in to comment.