openrat-cms

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

ModellistEditAction.class.php (725B)


      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 ModellistEditAction extends ModellistAction implements Method {
     10 
     11 	public function view() {
     12 		$project = new Project( $this->project->projectid );
     13 
     14 		$list = array();
     15 		foreach( $project->getModelIds() as $id )
     16 		{
     17 			$m = new Model( $id );
     18 			$m->load();
     19 
     20 			$list[$id]['id'  ] = $id;
     21 			$list[$id]['name'] = $m->name;
     22 
     23 			$list[$id]['is_default'] = $m->isDefault;
     24 			$list[$id]['select_url'] = Html::url('index','model',$id);
     25 		}
     26 		$this->setTemplateVar( 'el',$list );
     27 		$this->setTemplateVar( 'add',$this->userIsAdmin() );
     28 	}
     29 
     30     public function post() {
     31     }
     32 }