Skip to content

Commit

Permalink
Revert "Dev: Fix survey id argument to all doFooter calls"
Browse files Browse the repository at this point in the history
This reverts commit fa14ae4.
  • Loading branch information
olleharstedt committed Jan 23, 2017
1 parent 03d4432 commit 69359c1
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 16 deletions.
2 changes: 1 addition & 1 deletion application/controllers/OptinController.php
Expand Up @@ -117,7 +117,7 @@ private function _renderHtml($html, $aSurveyInfo, $iSurveyID)
$aData['thistpl'] = $thistpl;
$this->render('/opt_view',$aData);
echo templatereplace(file_get_contents($thistpl.'endpage.pstpl'),array(), $aSupportData);
doFooter($iSurveyID);
doFooter();
}

}
2 changes: 1 addition & 1 deletion application/controllers/OptoutController.php
Expand Up @@ -197,7 +197,7 @@ private function _renderHtml($html, $aSurveyInfo, $iSurveyID)
$aData['thistpl'] = $thistpl;
$this->renderPartial('/opt_view',$aData);
echo templatereplace(file_get_contents($thistpl.'endpage.pstpl'),array(), $aSupportData);
doFooter($iSurveyID);
doFooter();
ob_flush();
}

Expand Down
2 changes: 1 addition & 1 deletion application/controllers/PrintanswersController.php
Expand Up @@ -87,7 +87,7 @@ function actionView($surveyid,$printableexport=FALSE)
."\t".sprintf(gT("Please contact %s ( %s ) for further assistance."), Yii::app()->getConfig("siteadminname"), Yii::app()->getConfig("siteadminemail"))."\n"
."</center><br />\n";
echo templatereplace(file_get_contents($oTemplate->viewPath.'/endpage.pstpl'),array());
doFooter($iSurveyID);
doFooter();
exit;
}
//Fin session time out
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/RegisterController.php
Expand Up @@ -494,6 +494,6 @@ private function display($iSurveyId)
// Survey/index need renderPartial
echo $this->renderPartial('/register/display',$aViewData, true, true);
}
doFooter($iSurveyID);
doFooter();
}
}
4 changes: 2 additions & 2 deletions application/controllers/survey/index.php
Expand Up @@ -515,7 +515,7 @@ function action()
$this->_printTemplateContent($thistpl.'/clearall.pstpl', $redata, __LINE__);

$this->_printTemplateContent($thistpl.'/endpage.pstpl', $redata, __LINE__);
doFooter($surveyid);
doFooter();
exit;
}

Expand Down Expand Up @@ -719,7 +719,7 @@ function _niceExit(&$redata, $iDebugLine, $sTemplateDir = null, $asMessage = arr
$this->_printMessage($asMessage);
$this->_printTemplateContent($oTemplate->viewPath.'/endpage.pstpl', $redata, $iDebugLine);

doFooter($thissurvey['sid']);
doFooter();
exit;
}

Expand Down
Expand Up @@ -194,5 +194,5 @@
echo templatereplace(file_get_contents($oTemplate->viewPath."/startpage.pstpl"),array(),$data,'survey['.__LINE__.']');
echo templatereplace(file_get_contents($oTemplate->viewPath."/surveylist.pstpl"),array(),$data,'survey['.__LINE__.']');
echo templatereplace(file_get_contents($oTemplate->viewPath."/endpage.pstpl"),array(),$data,'survey['.__LINE__.']');
doFooter($survey->sid);
doFooter();
?>
10 changes: 2 additions & 8 deletions application/helpers/common_helper.php
Expand Up @@ -5702,16 +5702,10 @@ function getFooter()
return $embedded_footerfunc();
}

/**
* @param int|null $surveyid Null for front-end startpage where there's no survey
* @return void
*/
function doFooter($surveyid = null)
function doFooter($surveyid)
{
$event = new PluginEvent('beforeFooterRender');
if ($surveyid) {
$event->set('surveyId', $surveyid);
}
$event->set('surveyId', $surveyid);
App()->getPluginManager()->dispatchEvent($event);
if (!is_null($event->get('html')))
{
Expand Down
2 changes: 1 addition & 1 deletion application/libraries/Load_answers.php
Expand Up @@ -44,7 +44,7 @@ function run($args) {
echo "</form>";

echo templatereplace(file_get_contents($oTemplate->viewPath."endpage.pstpl"),array(),$redata);
doFooter($surveyid);
doFooter();
exit;


Expand Down

0 comments on commit 69359c1

Please sign in to comment.