File modules/cms/action/pageelement/PageelementReleaseAction.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\pageelement; 3 use cms\action\Method; 4 use cms\action\PageelementAction; 5 use cms\model\Permission; 6 use cms\model\Value; 7 use language\Messages; 8 use LogicException; 9 use util\exception\SecurityException; 10 11 class PageelementReleaseAction extends PageelementAction implements Method { 12 13 14 protected function getRequiredPagePermission() 15 { 16 return Permission::ACL_RELEASE; 17 } 18 19 public function view() { 20 } 21 public function post() { 22 23 $valueId = $this->request->getRequiredNumber('valueid'); 24 25 $this->ensureValueIdIsInAnyContent( $valueId ); 26 27 $value = new Value(); 28 $value->valueid = $valueId; 29 $value->loadWithId( $value->valueid ); 30 31 // Restore value. 32 $value->valueid = null; 33 $value->publish = true; 34 $value->persist(); 35 36 $this->addNoticeFor( $this->template,Messages::PAGEELEMENT_RELEASED ); 37 } 38 }
Downloadmodules/cms/action/pageelement/PageelementReleaseAction.class.php
History Sat, 27 Nov 2021 01:52:24 +0100 Jan Dankert New: Releasing and Restoring for file and template values. Wed, 10 Mar 2021 23:51:22 +0100 Jan Dankert Refactoring: Cleaned the Request params. Sat, 6 Mar 2021 03:42:38 +0100 Jan Dankert New: Better permission checks. Fri, 26 Feb 2021 01:06:01 +0100 Jan Dankert Refactoring accessing the request parameter values. Mon, 4 Jan 2021 19:03:18 +0100 Jan Dankert Refactoring: ACL class is renamed to Permission, because most RBAC/DMAC concepts are calling it a permission. Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class.