openrat-cms

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

TextValueAction.class.php (673B)


      1 <?php
      2 namespace cms\action\text;
      3 use cms\action\Method;
      4 use cms\action\RequestParams;
      5 use cms\action\TextAction;
      6 use cms\model\Permission;
      7 use language\Messages;
      8 
      9 
     10 class TextValueAction extends TextAction implements Method {
     11 
     12 	public function getRequiredPermission() {
     13 		return Permission::ACL_WRITE;
     14 	}
     15 
     16 
     17 	public function view() {
     18 
     19 		$this->setTemplateVar( 'text', $this->text->loadValue() );
     20     }
     21 
     22     public function post() {
     23 
     24 		$this->text->value  = $this->request->getText('text');
     25 		$this->text->public = $this->request->isTrue('release');
     26 		$this->text->saveValue();
     27 
     28 		$this->addNoticeFor($this->text,Messages::VALUE_SAVED);
     29 		$this->text->setTimestamp();
     30     }
     31 }