IndexAction.php 651 Bytes
Newer Older
Clément Damiens's avatar
 
Clément Damiens committed
1 2 3
 <?php
class IndexAction extends CAction
{
Raph El's avatar
Modif  
Raph El committed
4
    public function run($id=null, $answer=null, $tpl=null, $mode=null)
Clément Damiens's avatar
 
Clément Damiens committed
5 6 7 8 9 10
    {
    	$this->getController()->layout = "//layouts/empty";
		$params = ["canEdit" => true];
        if(!empty($id)){
            $params["answerId"]=$id;
        }
Raph El's avatar
Modif  
Raph El committed
11 12 13

        $params["mode"] = (!empty($mode) ? $mode : "r");
        //echo $params["mode"] ; exit;
Clément Damiens's avatar
 
Clément Damiens committed
14
        $params = Form::getDataForAnswer($params);
Raph El's avatar
Modif  
Raph El committed
15 16
        //$tpl=(!empty($tpl)) ? $tpl : "survey.views.tpls.forms.formWizard";
        $tpl=(!empty($tpl)) ? $tpl : "survey.views.tpls.views.index";
Clément Damiens's avatar
 
Clément Damiens committed
17 18
        echo $this->getController()->renderPartial($tpl,$params );
    }
Raph El's avatar
Modif  
Raph El committed
19
}