ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  {
98  $members->add($user_id, IL_GRP_MEMBER);
99  }
100 
101  return;
102  }
103 
108  public static function assignAdminsToGroup($context, $params)
109  {
110  /*
111  * Modelling:
112 
113  <bpmn2:extensionElements>
114  <ilias:properties>
115  <ilias:libraryCall location="Services/WorkflowEngine/classes/tasks/class.ilModulesGroupTasks.php" api="ilModulesGroupTasks" method="assignAdminsToGroup" />
116  </ilias:properties>
117  </bpmn2:extensionElements>
118 
119  */
120 
121  require_once './Modules/Group/classes/class.ilGroupParticipants.php';
122  $input_params = $params[0];
123  $output_params = $params[1];
124 
125  $participants = ilGroupParticipants::_getInstanceByObjId(ilObject::_lookupObjectId($input_params['grpRefId']));
126  foreach($input_params['usrIdList'] as $user_id)
127  {
128  $participants->add($user_id, IL_GRP_ADMIN);
129  }
130  return;
131  }
132 
133 }
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.
$params
Definition: example_049.php:96