openrat-cms

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

ProjectCopyAction.class.php (791B)


      1 <?php
      2 namespace cms\action\project;
      3 use cms\action\Method;
      4 use cms\action\ProjectAction;
      5 use cms\base\Configuration;
      6 use cms\base\DB;
      7 use language\Messages;
      8 
      9 class ProjectCopyAction extends ProjectAction implements Method {
     10     public function view() {
     11     }
     12 
     13     public function post() {
     14 		$db = DB::get();
     15 		$this->setTemplateVar( 'dbid',$db->id );
     16 
     17 		$conf = Configuration::rawConfig();
     18 		$dbids = array();
     19 		
     20 		foreach( $conf['database'] as $dbname=>$dbconf )
     21 		{
     22 			if	( is_array($dbconf) && $dbconf['enabled'])
     23 				$dbids[$dbname] = $dbconf['description'];
     24 		}
     25 		$this->setTemplateVar( 'dbids',$dbids );
     26 		
     27 		
     28 		if	( $this->request->isTrue('ok') )
     29 		{
     30 			$this->project->export( $this->request->getDatabaseId() );
     31 			
     32 			$this->addNoticeFor($this->project,Messages::DONE);
     33 		}
     34     }
     35 }