File modules/cms/action/template/TemplateEditAction.class.php
Last commit: Sat Jan 28 19:10:47 2023 +0100 Jan Dankert New: Templates may be rendered as Mustache, Script and Script template.
1 <?php 2 namespace cms\action\template; 3 use cms\action\Method; 4 use cms\action\TemplateAction; 5 use cms\model\Element; 6 use cms\model\Project; 7 use cms\model\TemplateModel; 8 9 10 class TemplateEditAction extends TemplateAction implements Method { 11 public function view() { 12 // Elemente laden 13 $list = array(); 14 15 foreach( $this->template->getElementIds() as $elid ) 16 { 17 $element = new Element( $elid ); 18 $element->load(); 19 20 $list[$elid] = array(); 21 $list[$elid]['id' ] = $elid; 22 $list[$elid]['name' ] = $element->name; 23 $list[$elid]['description'] = $element->desc; 24 $list[$elid]['type' ] = $element->getTypeName(); 25 $list[$elid]['typeid' ] = $element->typeid; 26 27 unset( $element ); 28 } 29 $this->setTemplateVar('elements',$list); 30 31 32 $project = new Project( $this->template->projectid ); 33 34 35 $models = array(); 36 37 foreach( $project->getModels() as $modelId => $modelName ) 38 { 39 $templateModel = new TemplateModel( $this->template->templateid, $modelId ); 40 $templateModel->load(); 41 42 $models[ $modelId ] = array( 43 'name' => $modelName, 44 'source' => $templateModel->getSource(), 45 'format' => $templateModel->format, 46 'modelid' => $modelId 47 ); 48 } 49 50 $this->setTemplateVar( 'models',$models ); 51 52 53 } 54 public function post() { 55 } 56 }
Downloadmodules/cms/action/template/TemplateEditAction.class.php
History Sat, 28 Jan 2023 19:10:47 +0100 Jan Dankert New: Templates may be rendered as Mustache, Script and Script template. Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class.