openrat-cms

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

ModelRemoveAction.class.php (540B)


      1 <?php
      2 namespace cms\action\model;
      3 use cms\action\Method;
      4 use cms\action\ModelAction;
      5 use language\Messages;
      6 
      7 
      8 class ModelRemoveAction extends ModelAction implements Method {
      9     public function view() {
     10 		$this->model->load();
     11 
     12 		$this->setTemplateVar( 'name',$this->model->name );
     13     }
     14     public function post() {
     15 		if   ( $this->request->isTrue('confirm') )
     16 		{
     17 			$this->model->delete();
     18 			$this->addNoticeFor( $this->model, Messages::DONE );
     19 		}
     20 		else
     21 		{
     22 			$this->addWarningFor( $this->model, Messages::NOTHING_DONE);
     23 		}
     24     }
     25 }