openrat-cms

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

ProjectPropAction.class.php (1748B)


      1 <?php
      2 namespace cms\action\project;
      3 use cms\action\Method;
      4 use cms\action\ProjectAction;
      5 use cms\action\RequestParams;
      6 use cms\model\Folder;
      7 use language\Messages;
      8 
      9 class ProjectPropAction extends ProjectAction implements Method {
     10     public function view() {
     11 		$extraProperties = array(
     12 		    'rootobjectid'  => $this->project->getRootObjectId(),
     13             'linksAbsolute' => $this->project->linkAbsolute?'1':'0'
     14         );
     15 		
     16 		$this->setTemplateVars( $this->project->getProperties() + $extraProperties );
     17 
     18     }
     19     public function post() {
     20 
     21 		$this->project->name                 = $this->request->getRequiredText('name' );
     22 		$this->project->url                  = $this->request->getAlphanum('url'                );
     23 		$this->project->target_dir           = $this->request->getRaw('target_dir'              );
     24 		$this->project->ftp_url              = $this->request->getRaw('ftp_url'                 );
     25 		$this->project->ftp_passive          = $this->request->getRaw('ftp_passive'             );
     26 		$this->project->cmd_after_publish    = $this->request->getRaw('cmd_after_publish'       );
     27 		$this->project->content_negotiation  = $this->request->getNumber('content_negotiation'  );
     28 		$this->project->cut_index            = $this->request->getNumber('cut_index'            );
     29 		$this->project->publishFileExtension = $this->request->getNumber('publishFileExtension' );
     30 		$this->project->publishPageExtension = $this->request->getNumber('publishPageExtension' );
     31 		$this->project->linkAbsolute         = $this->request->getNumber('linksAbsolute'        );
     32 
     33 		$this->addNoticeFor($this->project,Messages::SAVED);
     34 		$this->project->save(); // speichern
     35 
     36 		$root = new Folder( $this->project->getRootObjectId() );
     37 		$root->setTimestamp();
     38     }
     39 }