Skip to content

Commit

Permalink
Dev: removed setForcedPath logic (replace by inheritance inclusion)
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed May 23, 2017
1 parent 1a8c647 commit fde3914
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 17 deletions.
2 changes: 0 additions & 2 deletions application/controllers/SurveysController.php
Expand Up @@ -58,8 +58,6 @@ public function actionPublicList($lang = null)
Yii::app()->clientScript->registerScriptFile(Yii::app()->getConfig("generalscripts").'nojs.js',CClientScript::POS_HEAD);

$sTemplateViewPath = $oTemplate->viewPath;

Yii::app()->twigRenderer->setForcedPath($sTemplateViewPath);
Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($sTemplateViewPath."layout_survey_list.twig"), array('aSurveyInfo'=>$aData), false);

}
Expand Down
1 change: 0 additions & 1 deletion application/controllers/survey/index.php
Expand Up @@ -408,7 +408,6 @@ function action()

$aLoadForm['aErrors'] = empty($aLoadErrorMsg) ? null : $aLoadErrorMsg; // Set tit to null if empty
$thissurvey['aLoadForm'] = $aLoadForm;
Yii::app()->twigRenderer->setForcedPath($oTemplate->viewPath);
$oTemplate->registerAssets();
Yii::app()->twigRenderer->renderTemplateFromString( file_get_contents($oTemplate->viewPath."layout_load.twig"), array('aSurveyInfo'=>$thissurvey), false);
}
Expand Down
12 changes: 0 additions & 12 deletions application/core/LSETwigViewRenderer.php
Expand Up @@ -26,7 +26,6 @@ class LSETwigViewRenderer extends ETwigViewRenderer
*/
public $sandboxConfig = array();
private $_twig;
private $forcedPath = null;

/**
* Adds custom extensions
Expand Down Expand Up @@ -137,17 +136,6 @@ public function renderQuestion( $sView, $aData)
}
}

/**
* Only use for renderTemplateFromString for now, to force the path of included twig files (in renderTemplateFromString: the template files)
* It's necessary for the twig include statments: by default, those views would be looked into application/views instead of the template's views directory.
* @param string $sPath the path that will be used to render the views.
*/
public function setForcedPath($sPath)
{
$this->forcedPath=$sPath;
}


/**
* Render a string, not a file. It's used from template replace function.
*
Expand Down
1 change: 0 additions & 1 deletion application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -1618,7 +1618,6 @@ private function initTemplate()
$oTemplate = $this->oTemplate = Template::model()->getInstance('', $this->iSurveyid);
$this->sTemplateViewPath = $oTemplate->viewPath;
$oTemplate->registerAssets();
Yii::app()->twigRenderer->setForcedPath($this->sTemplateViewPath);
}

private function makeLanguageChanger()
Expand Down
1 change: 0 additions & 1 deletion application/helpers/frontend_helper.php
Expand Up @@ -1518,7 +1518,6 @@ function renderError($sTitle='', $sMessage, $thissurvey, $sTemplateViewPath )
$oTemplate = Template::model()->getInstance('', $surveyid);
$sTemplateViewPath = $oTemplate->viewPath;
$oTemplate->registerAssets();
Yii::app()->twigRenderer->setForcedPath($sTemplateViewPath);

$aError = array();
$aError['title'] = ($sTitle != '')?$sTitle:gT("This survey cannot be tested or completed for the following reason(s):");
Expand Down

0 comments on commit fde3914

Please sign in to comment.