ModellistShowAction.class.php (757B)
1 <?php 2 namespace cms\action\modellist; 3 use cms\action\Method; 4 use cms\action\ModellistAction; 5 use cms\model\Model; 6 use cms\model\Project; 7 use util\Html; 8 9 class ModellistShowAction extends ModellistAction implements Method { 10 public function view() { 11 $project = new Project( $this->project->projectid ); 12 13 $list = array(); 14 foreach( $project->getModelIds() as $id ) 15 { 16 $m = new Model( $id ); 17 $m->load(); 18 19 $list[$id]['id' ] = $id; 20 $list[$id]['name'] = $m->name; 21 22 $list[$id]['is_default'] = $m->isDefault; 23 $list[$id]['select_url'] = Html::url('index','model',$id); 24 } 25 $this->setTemplateVar( 'el',$list ); 26 $this->setTemplateVar( 'add',$this->userIsAdmin() ); 27 } 28 29 public function post() { 30 } 31 }