File modules/cms/action/template/TemplateReleaseAction.class.php

Last commit: Sat Oct 17 02:16:28 2026 +0200	Jan Dankert	Refactoring: Removed empty view() and post() methods; OpenAPI cleanup, removed these unused paths.
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 17 18 19 public function post() { 20 21 $valueId = $this->request->getRequiredNumber('valueid'); 22 23 $this->ensureValueIdIsInAnyTemplate( $valueId ); 24 25 $value = new Value(); 26 $value->valueid = $valueId; 27 $value->loadWithId( $value->valueid ); 28 29 // Publish value. 30 $value->valueid = null; 31 $value->publish = true; 32 $value->persist(); 33 34 $this->addNoticeFor($this->template, Messages::PAGEELEMENT_RELEASED ); 35 } 36 }
Download modules/cms/action/template/TemplateReleaseAction.class.php
History Sat, 17 Oct 2026 02:16:28 +0200 Jan Dankert Refactoring: Removed empty view() and post() methods; OpenAPI cleanup, removed these unused paths. Sat, 27 Nov 2021 01:52:24 +0100 Jan Dankert New: Releasing and Restoring for file and template values.