TemplatePreviewAction.class.php (796B)
1 <?php 2 namespace cms\action\template; 3 use cms\action\Method; 4 use cms\action\RequestParams; 5 use cms\action\TemplateAction; 6 use cms\model\Project; 7 use util\Html; 8 9 10 class TemplatePreviewAction extends TemplateAction implements Method { 11 12 public function view() { 13 $project = new Project( $this->template->projectid); 14 15 $this->setTemplateVar('models',$project->getModels() ); 16 17 $modelId = $this->request->getModelId(); 18 if ( ! $modelId ) 19 $modelId = Project::create( $this->template->projectid )->getDefaultModelId(); 20 21 $this->setTemplateVar('modelid' ,$modelId); 22 23 $this->setTemplateVar('preview_url',Html::url('template','show',$this->template->templateid,array('target'=>'none','modelid'=>$modelId,'output'=>'preview' ) ) ); 24 } 25 public function post() { 26 } 27 }