Skip to content

Commit

Permalink
Dev: Template fix for optin
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Mar 15, 2016
1 parent 9f0b7ec commit da2ef06
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions application/controllers/OptinController.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,26 +88,28 @@ function actiontokens($surveyid, $token, $langcode = '')
}
}

//PRINT COMPLETED PAGE
if (!$aSurveyInfo['templatedir'])
{
$sTemplate=getTemplatePath(Yii::app()->getConfig("defaulttemplate"));
}
else
{
$sTemplate=getTemplatePath($aSurveyInfo['templatedir']);
}
$this->_renderHtml($sMessage,$sTemplate,$aSurveyInfo);
$this->_renderHtml($sMessage, $aSurveyInfo, $iSurveyID);
}

private function _renderHtml($html,$thistpl, $aSurveyInfo)
/**
* Render stuff
*
* @param string $html
* @param array $aSurveyInfo
* @param int $iSurveyID
* @return void
*/
private function _renderHtml($html, $aSurveyInfo, $iSurveyID)
{
sendCacheHeaders();
doHeader();
$aSupportData=array('thissurvey'=>$aSurveyInfo);

$oTemplate = Template::model()->getInstance();
$sTemplatePath = $oTemplate->path;
$oTemplate = Template::model()->getInstance(null, $iSurveyID);
if($oTemplate->cssFramework == 'bootstrap')
{
App()->bootstrap->register();
}
$thistpl = $oTemplate->viewPath;

echo templatereplace(file_get_contents($thistpl.'startpage.pstpl'),array(), $aSupportData);
Expand Down

0 comments on commit da2ef06

Please sign in to comment.