File modules/cms/action/script/ScriptValueAction.class.php

Last commit: Sun Jan 29 00:20:21 2023 +0100	Jan Dankert	New node type "Script".
1 <?php 2 namespace cms\action\script; 3 use cms\action\Method; 4 use cms\action\RequestParams; 5 use cms\action\ScriptAction; 6 use cms\action\TextAction; 7 use cms\model\Permission; 8 use language\Messages; 9 10 11 class ScriptValueAction extends ScriptAction implements Method { 12 13 public function getRequiredPermission() { 14 return Permission::ACL_WRITE; 15 } 16 17 18 public function view() { 19 20 $this->setTemplateVar( 'text', $this->script->loadValue() ); 21 } 22 23 public function post() { 24 25 $this->script->value = $this->request->getText('text'); 26 $this->script->public = $this->request->isTrue('release'); 27 $this->script->saveValue(); 28 29 $this->addNoticeFor($this->script,Messages::VALUE_SAVED); 30 $this->script->setTimestamp(); 31 } 32 }
Download modules/cms/action/script/ScriptValueAction.class.php
History Sun, 29 Jan 2023 00:20:21 +0100 Jan Dankert New node type "Script".