ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilModulesGroupTasks.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2016 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
12 {
19  public static function readMembersFromGroup($context, $params)
20  {
21  /*
22  * Modelling:
23 
24  <bpmn2:extensionElements>
25  <ilias:properties>
26  <ilias:libraryCall location="Services/WorkflowEngine/classes/tasks/class.ilModulesGroupTasks.php" api="ilModulesGroupTasks" method="readMembersFromGroup" />
27  </ilias:properties>
28  </bpmn2:extensionElements>
29 
30  */
31  require_once './Modules/Group/classes/class.ilGroupParticipants.php';
32  $input_params = $params[0];
33  $output_params = $params[1];
34 
35  $participants = ilGroupParticipants::_getInstanceByObjId(ilObject::_lookupObjectId($input_params['grpRefId']));
36  $members = $participants->getMembers();
37  $retval = array($output_params[0] => $members);
38 
39  return $retval;
40  }
41 
48  public static function readAdminsFromGroup($context, $params)
49  {
50  /*
51  * Modelling:
52 
53  <bpmn2:extensionElements>
54  <ilias:properties>
55  <ilias:libraryCall location="Services/WorkflowEngine/classes/tasks/class.ilModulesGroupTasks.php" api="ilModulesGroupTasks" method="readAdminsFromGroup" />
56  </ilias:properties>
57  </bpmn2:extensionElements>
58 
59  */
60 
61  require_once './Modules/Group/classes/class.ilGroupParticipants.php';
62  $input_params = $params[0];
63  $output_params = $params[1];
64 
65  $participants = ilGroupParticipants::_getInstanceByObjId(ilObject::_lookupObjectId($input_params['grpRefId']));
66  $admins = $participants->getAdmins();
67  $retval = array($output_params[0] => $admins);
68 
69  return $retval;
70  }
71 
78  public static function assignMembersToGroup($context, $params)
79  {
80  /*
81  * Modelling:
82 
83  <bpmn2:extensionElements>
84  <ilias:properties>
85  <ilias:libraryCall location="Services/WorkflowEngine/classes/tasks/class.ilModulesGroupTasks.php" api="ilModulesGroupTasks" method="assignMembersToGroup" />
86  </ilias:properties>
87  </bpmn2:extensionElements>
88 
89  */
90 
91  require_once './Modules/Group/classes/class.ilGroupParticipants.php';
92  $input_params = $params[0];
93  $output_params = $params[1];
94 
95  $members = ilGroupParticipants::_getInstanceByObjId(ilObject::_lookupObjectId($input_params['grpRefId']));
96  foreach ($input_params['usrIdList'] as $user_id) {
97  $members->add($user_id, IL_GRP_MEMBER);
98  }
99 
100  return;
101  }
102 
107  public static function assignAdminsToGroup($context, $params)
108  {
109  /*
110  * Modelling:
111 
112  <bpmn2:extensionElements>
113  <ilias:properties>
114  <ilias:libraryCall location="Services/WorkflowEngine/classes/tasks/class.ilModulesGroupTasks.php" api="ilModulesGroupTasks" method="assignAdminsToGroup" />
115  </ilias:properties>
116  </bpmn2:extensionElements>
117 
118  */
119 
120  require_once './Modules/Group/classes/class.ilGroupParticipants.php';
121  $input_params = $params[0];
122  $output_params = $params[1];
123 
124  $participants = ilGroupParticipants::_getInstanceByObjId(ilObject::_lookupObjectId($input_params['grpRefId']));
125  foreach ($input_params['usrIdList'] as $user_id) {
126  $participants->add($user_id, IL_GRP_ADMIN);
127  }
128  return;
129  }
130 }
$params
Definition: disable.php:11
static assignAdminsToGroup($context, $params)
const IL_GRP_ADMIN
static readMembersFromGroup($context, $params)
const IL_GRP_MEMBER
static assignMembersToGroup($context, $params)
static _lookupObjectId($a_ref_id)
lookup object id
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
Create styles array
The data for the language used.
static readAdminsFromGroup($context, $params)
Class ilModulesGroupTasks.