File modules/cms/action/template/TemplateReleaseAction.class.php
Last commit: Sat Nov 27 01:52:24 2021 +0100 Jan Dankert New: Releasing and Restoring for file and template values.
1 <?php 2 namespace cms\action\template; 3 use cms\action\ContentAction; 4 use cms\action\Method; 5 use cms\action\PageelementAction; 6 use cms\action\TemplateAction; 7 use cms\model\Permission; 8 use cms\model\Value; 9 use language\Messages; 10 use LogicException; 11 use util\exception\SecurityException; 12 13 class TemplateReleaseAction extends TemplateAction implements Method { 14 15 16 public function view() { 17 } 18 19 20 public function post() { 21 22 $valueId = $this->request->getRequiredNumber('valueid'); 23 24 $this->ensureValueIdIsInAnyTemplate( $valueId ); 25 26 $value = new Value(); 27 $value->valueid = $valueId; 28 $value->loadWithId( $value->valueid ); 29 30 // Publish value. 31 $value->valueid = null; 32 $value->publish = true; 33 $value->persist(); 34 35 $this->addNoticeFor($this->template, Messages::PAGEELEMENT_RELEASED ); 36 } 37 }
Downloadmodules/cms/action/template/TemplateReleaseAction.class.php
History Sat, 27 Nov 2021 01:52:24 +0100 Jan Dankert New: Releasing and Restoring for file and template values.