File modules/cms/action/group/GroupPropAction.class.php

Last commit: Thu Apr 24 00:13:35 2025 +0200	Jan Dankert	New: OpenAPI with REST interface for all actions and methods
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 * Stores the name and the parentid of this group. 33 * @api name*|string|name of group 34 * @api parentid|integer|ID of parent group 35 * 36 * @throws ValidationException 37 */ 38 public function post() { 39 40 $this->group->name = $this->request->getRequiredText('name'); 41 $this->group->parentid = $this->request->getNumber('parentid'); 42 43 if ( ! $this->group->parentid ) 44 $this->group->parentid = null; 45 46 $this->group->persist(); 47 48 $this->addNoticeFor($this->group,Messages::SAVED); 49 } 50 }
Download modules/cms/action/group/GroupPropAction.class.php
History Thu, 24 Apr 2025 00:13:35 +0200 Jan Dankert New: OpenAPI with REST interface for all actions and methods 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.