File modules/cms/action/group/GroupPropAction.class.php
Last commit: Wed Mar 10 23:51:22 2021 +0100 Jan Dankert Refactoring: Cleaned the Request params.
1 <?php 2 namespace cms\action\group; 3 use cms\action\GroupAction; 4 use cms\action\Method; 5 use cms\model\Group; 6 use language\Messages; 7 use util\exception\ValidationException; 8 9 10 class GroupPropAction extends GroupAction implements Method { 11 12 /** 13 * Reads the properties of this group. 14 */ 15 public function view() { 16 17 $this->setTemplateVars( $this->group->getProperties() ); 18 19 $otherGroups = Group::getAll(); 20 21 unset( $otherGroups[$this->group->groupid] ); 22 23 foreach ( $this->group->getAllDescendantsIds() as $descendantGroupId ) 24 unset( $otherGroups[ $descendantGroupId ] ); 25 26 $this->setTemplateVar('groups',$otherGroups ); 27 } 28 29 30 /** 31 * Store the group properties. 32 * 33 * @throws ValidationException 34 */ 35 public function post() { 36 37 $this->group->name = $this->request->getRequiredText('name'); 38 $this->group->parentid = $this->request->getNumber('parentid'); 39 40 if ( ! $this->group->parentid ) 41 $this->group->parentid = null; 42 43 $this->group->persist(); 44 45 $this->addNoticeFor($this->group,Messages::SAVED); 46 } 47 }
Downloadmodules/cms/action/group/GroupPropAction.class.php
History Wed, 10 Mar 2021 23:51:22 +0100 Jan Dankert Refactoring: Cleaned the Request params. Fri, 26 Feb 2021 01:06:01 +0100 Jan Dankert Refactoring accessing the request parameter values. Mon, 4 Jan 2021 23:14:09 +0100 Jan Dankert New: Groups may contain subgroups. Users within a group inherit the permissions of all parent groups. Thu, 19 Nov 2020 14:49:58 +0100 Jan Dankert Fix: Action::addNotice() is replaced by Action::addNoticeFor() Tue, 17 Nov 2020 23:51:00 +0100 Jan Dankert Refactoring: Every Actionmethod has now its own class.