ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilGroupAddToGroupActionGUI Class Reference

Add user to group from awareness tool. More...

+ Collaboration diagram for ilGroupAddToGroupActionGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 
 show ()
 
 sendResponse (string $a_content)
 
 selectGroup ()
 
 confirmAddUser ()
 
 addUser ()
 
 selectParent ()
 
 createGroup ($form=null)
 
 confirmCreateGroupAndAddUser ()
 
 createGroupAndAddUser ()
 

Protected Member Functions

 initGroupRefIdFromQuery ()
 
 initGroupParentRefIdFromQuery ()
 
 initUserIdFromQuery ()
 
 getGroupCreationForm ()
 

Protected Attributes

ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
UIServices $ui
 
ilLanguage $lng
 
ilTree $tree
 
ilObjUser $user
 
GlobalHttpState $http
 
Factory $refinery
 

Detailed Description

Add user to group from awareness tool.

Author
Alex Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 17 of file class.ilGroupAddToGroupActionGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilGroupAddToGroupActionGUI::__construct ( )

Definition at line 32 of file class.ilGroupAddToGroupActionGUI.php.

References $DIC, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ILIAS\Repository\ui(), and ILIAS\Repository\user().

33  {
34  global $DIC;
35 
36  $this->ctrl = $DIC->ctrl();
37  $this->tpl = $DIC->ui()->mainTemplate();
38  $this->ui = $DIC->ui();
39  $this->lng = $DIC->language();
40  $this->tree = $DIC->repositoryTree();
41  $this->user = $DIC->user();
42  $this->http = $DIC->http();
43  $this->refinery = $DIC->refinery();
44 
45 
46  $this->lng->loadLanguageModule("grp");
47  $this->ctrl->saveParameter($this, array("user_id", "modal_exists"));
48  }
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

Member Function Documentation

◆ addUser()

ilGroupAddToGroupActionGUI::addUser ( )

Definition at line 238 of file class.ilGroupAddToGroupActionGUI.php.

References $lng, $ref_id, exit, ilParticipants\getInstanceByObjId(), ilUtil\getSystemMessageHTML(), ilParticipants\IL_GRP_MEMBER, initGroupRefIdFromQuery(), initUserIdFromQuery(), ilLanguage\txt(), and ilGroupMembershipMailNotification\TYPE_ADMISSION_MEMBER.

238  : void
239  {
240  $lng = $this->lng;
241 
242  $ref_id = $this->initGroupRefIdFromQuery();
243  $user_id = $this->initUserIdFromQuery();
244 
245  // @todo: check permission
246 
247  $group = new ilObjGroup($ref_id);
248  $participants = ilParticipants::getInstanceByObjId($group->getId());
249 
250  $participants->add($user_id, ilParticipants::IL_GRP_MEMBER);
251 
252  $participants->sendNotification(
254  $user_id
255  );
256 
257  echo ilUtil::getSystemMessageHTML($lng->txt("grp_user_been_added"), "success");
258  echo "<script>setTimeout(function (){ il.Group.UserActions.closeModal();}, 1000);</script>";
259  exit;
260  }
exit
Definition: login.php:28
static getSystemMessageHTML(string $a_txt, string $a_type="info")
Get HTML for a system message.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getInstanceByObjId(int $a_obj_id)
Get instance by obj type.
$ref_id
Definition: ltiauth.php:67
Class ilObjGroup.
+ Here is the call graph for this function:

◆ confirmAddUser()

ilGroupAddToGroupActionGUI::confirmAddUser ( )

Definition at line 198 of file class.ilGroupAddToGroupActionGUI.php.

References $ctrl, $id, $lng, $ref_id, $url, ilObject\_lookupObjId(), ilObject\_lookupTitle(), exit, ilParticipants\getInstanceByObjId(), ilCtrl\getLinkTarget(), ilUserUtil\getNamePresentation(), ilUtil\getSystemMessageHTML(), initGroupRefIdFromQuery(), initUserIdFromQuery(), ilCtrl\setParameter(), ilLanguage\txt(), ILIAS\Repository\ui(), and ILIAS\UI\Implementation\Component\withOnLoadCode().

198  : void
199  {
200  $ctrl = $this->ctrl;
201  $lng = $this->lng;
202 
203  $ref_id = $this->initGroupRefIdFromQuery();
204  $user_id = $this->initUserIdFromQuery();
206  if ($participants->isMember($user_id)) {
207  $url = $ctrl->getLinkTarget($this, "selectGroup", "", true);
208  $button = $this->ui->factory()->button()->standard($lng->txt("back"), "#")
209  ->withOnLoadCode(function ($id) use ($url) {
210  return "$('#$id').on('click', function() {il.Util.ajaxReplaceInner('$url', 'il_grp_action_modal_content'); return false;})";
211  });
212 
213  echo
214  ilUtil::getSystemMessageHTML($lng->txt("grp_user_already_in_group") . "<br>" .
215  $lng->txt("obj_user") . ": " . ilUserUtil::getNamePresentation($user_id) . "<br>" .
216  $lng->txt("obj_grp") . ": " . ilObject::_lookupTitle(ilObject::_lookupObjId($ref_id)), "failure") .
217  $this->ui->renderer()->renderAsync($button);
218  exit;
219  }
220 
221 
222  // button create new group
223  $ctrl->setParameter($this, "grp_act_ref_id", $ref_id);
224  $url = $ctrl->getLinkTarget($this, "addUser", "", true);
225  $button = $this->ui->factory()->button()->standard($lng->txt("grp_add_user"), "#")
226  ->withOnLoadCode(function ($id) use ($url) {
227  return "$('#$id').on('click', function() {il.Util.ajaxReplaceInner('$url', 'il_grp_action_modal_content'); return false;})";
228  });
229 
230  echo
231  ilUtil::getSystemMessageHTML($lng->txt("grp_sure_add_user_to_group") . "<br>" .
232  $lng->txt("obj_user") . ": " . ilUserUtil::getNamePresentation($user_id) . "<br>" .
233  $lng->txt("obj_grp") . ": " . ilObject::_lookupTitle(ilObject::_lookupObjId($ref_id)), "question") .
234  $this->ui->renderer()->renderAsync($button);
235  exit;
236  }
exit
Definition: login.php:28
static getSystemMessageHTML(string $a_txt, string $a_type="info")
Get HTML for a system message.
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link="", bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getInstanceByObjId(int $a_obj_id)
Get instance by obj type.
static _lookupObjId(int $ref_id)
$ref_id
Definition: ltiauth.php:67
static _lookupTitle(int $obj_id)
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$url
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ confirmCreateGroupAndAddUser()

ilGroupAddToGroupActionGUI::confirmCreateGroupAndAddUser ( )

Definition at line 313 of file class.ilGroupAddToGroupActionGUI.php.

References $id, $lng, createGroup(), ILIAS\Repository\ctrl(), exit, getGroupCreationForm(), ilUserUtil\getNamePresentation(), ilUtil\getSystemMessageHTML(), ILIAS\FileDelivery\http(), initUserIdFromQuery(), ILIAS\Repository\refinery(), ilLanguage\txt(), ILIAS\Repository\ui(), and ILIAS\UI\Implementation\Component\withOnLoadCode().

313  : void
314  {
315  $lng = $this->lng;
316 
317  $user_id = $this->initUserIdFromQuery();
318  $title = '';
319  if ($this->http->wrapper()->post()->has('title')) {
320  $title = $this->http->wrapper()->post()->retrieve(
321  'title',
322  $this->refinery->kindlyTo()->string()
323  );
324  }
325  $form = $this->getGroupCreationForm();
326 
327 
328 
329  if (!$form->checkInput()) {
330  $this->createGroup($form);
331  return;
332  }
333 
334  $this->ctrl->saveParameter($this, "grp_act_par_ref_id");
335  $form->setFormAction($this->ctrl->getLinkTarget($this, "createGroupAndAddUser", "", true));
336  $form->setValuesByPost();
337 
338  $button = $this->ui->factory()->button()->standard($lng->txt("grp_create_and_add_user"), "#")
339  ->withOnLoadCode(function ($id) {
340  return "$('#$id').on('click', function(e) {il.Group.UserActions.createGroup(e);})";
341  });
342 
343  echo
344  ilUtil::getSystemMessageHTML($lng->txt("grp_sure_create_group_add_user") . "<br>" .
345  $lng->txt("obj_user") . ": " . ilUserUtil::getNamePresentation($user_id) . "<br>" .
346  $lng->txt("obj_grp") . ": " . $title, "question") .
347  "<div class='ilNoDisplay'>" . $form->getHTML() . "</div>" .
348  "<div class='ilRight'>" . $this->ui->renderer()->renderAsync($button) . "</div>";
349 
350  exit;
351  }
exit
Definition: login.php:28
static getSystemMessageHTML(string $a_txt, string $a_type="info")
Get HTML for a system message.
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link="", bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static http()
Fetches the global http state from ILIAS.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ createGroup()

ilGroupAddToGroupActionGUI::createGroup (   $form = null)

Definition at line 280 of file class.ilGroupAddToGroupActionGUI.php.

References $lng, $ref_id, ilObject\_lookupObjId(), ilObject\_lookupTitle(), ILIAS\Repository\ctrl(), exit, getGroupCreationForm(), ilUtil\getSystemMessageHTML(), initGroupParentRefIdFromQuery(), and ilLanguage\txt().

Referenced by confirmCreateGroupAndAddUser().

280  : void
281  {
282  $lng = $this->lng;
283 
285 
286  if ($form == null) {
287  $form = $this->getGroupCreationForm();
288  }
289  $this->ctrl->saveParameter($this, "grp_act_par_ref_id");
290  $form->setFormAction($this->ctrl->getLinkTarget($this, "confirmCreateGroupAndAddUser", "", true));
291 
292  echo ilUtil::getSystemMessageHTML(str_replace("%1", ilObject::_lookupTitle(ilObject::_lookupObjId($ref_id)), $lng->txt("grp_create_new_grp_in")), "info") .
293  $form->getHTML();
294  exit;
295  }
exit
Definition: login.php:28
static getSystemMessageHTML(string $a_txt, string $a_type="info")
Get HTML for a system message.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _lookupObjId(int $ref_id)
$ref_id
Definition: ltiauth.php:67
static _lookupTitle(int $obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createGroupAndAddUser()

ilGroupAddToGroupActionGUI::createGroupAndAddUser ( )

Definition at line 353 of file class.ilGroupAddToGroupActionGUI.php.

References $lng, $ref_id, $url, ilLink\_getLink(), exit, getGroupCreationForm(), ilParticipants\getInstanceByObjId(), ilUtil\getSystemMessageHTML(), ilParticipants\IL_GRP_MEMBER, initGroupParentRefIdFromQuery(), initUserIdFromQuery(), ilLanguage\txt(), and ilGroupMembershipMailNotification\TYPE_ADMISSION_MEMBER.

353  : void
354  {
355  $lng = $this->lng;
356 
357  $user_id = $this->initUserIdFromQuery();
359  $form = $this->getGroupCreationForm();
360 
361  $form->checkInput();
362 
363  $group_gui = new ilObjGroupGUI("", 0, true);
364 
365  // create instance
366  $newObj = new ilObjGroup();
367  $newObj->setType("grp");
368  $newObj->setTitle($form->getInput("title"));
369  $newObj->setDescription($form->getInput("desc"));
370  $newObj->create();
371 
372  $group_gui->putObjectInTree($newObj, $ref_id);
373 
374  // apply didactic template?
375  $dtpl = $group_gui->getDidacticTemplateVar("dtpl");
376  if ($dtpl) {
377  $newObj->applyDidacticTemplate($dtpl);
378  }
379 
380  $group_gui->afterSave($newObj, false);
381 
382 
383  $participants = ilParticipants::getInstanceByObjId($newObj->getId());
384 
385  $participants->add($user_id, ilParticipants::IL_GRP_MEMBER);
386 
387  $participants->sendNotification(
389  $user_id
390  );
391 
392 
393  $url = ilLink::_getLink($newObj->getRefId());
394  echo ilUtil::getSystemMessageHTML($lng->txt("grp_created_and_user_been_added"), "success");
395  echo "<script>setTimeout(function (){ window.location.replace('$url');}, 1500);</script>";
396  exit;
397  }
exit
Definition: login.php:28
static getSystemMessageHTML(string $a_txt, string $a_type="info")
Get HTML for a system message.
Class ilObjGroupGUI.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static getInstanceByObjId(int $a_obj_id)
Get instance by obj type.
$ref_id
Definition: ltiauth.php:67
Class ilObjGroup.
$url
+ Here is the call graph for this function:

◆ executeCommand()

ilGroupAddToGroupActionGUI::executeCommand ( )

Definition at line 86 of file class.ilGroupAddToGroupActionGUI.php.

References $ctrl, $user, ilCtrl\getCmd(), ilGroupUserActionProvider\getCommandAccess(), ilObject\getId(), ilCtrl\getNextClass(), and ilCtrl\setParameter().

86  : void
87  {
90 
91  $next_class = $ctrl->getNextClass($this);
92  $cmd = $ctrl->getCmd("show");
93 
94  if ($cmd == "show") {
96  if (count($ca) == 0) {
97  return;
98  }
99  if (count($ca) == 1) {
100  switch (current($ca)) {
101  case "create_grp":
102  $cmd = "selectParent";
103  break;
104 
105  case "manage_members":
106  $cmd = "selectGroup";
107  break;
108 
109  default:
110  return;
111  }
112  }
113  }
114 
115  switch ($next_class) {
116  default:
117  if (in_array($cmd, array("show", "selectGroup", "confirmAddUser", "addUser",
118  "selectParent", "createGroup", "confirmCreateGroupAndAddUser", "createGroupAndAddUser"))) {
119  $ctrl->setParameter($this, "modal_exists", 1);
120  $this->$cmd();
121  }
122  }
123  }
getCmd(string $fallback_command=null)
getNextClass($a_gui_class=null)
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ getGroupCreationForm()

ilGroupAddToGroupActionGUI::getGroupCreationForm ( )
protected

Definition at line 298 of file class.ilGroupAddToGroupActionGUI.php.

References $lng, $ref_id, initGroupRefIdFromQuery(), and ilLanguage\txt().

Referenced by confirmCreateGroupAndAddUser(), createGroup(), and createGroupAndAddUser().

299  {
300  $lng = $this->lng;
301 
302  $ref_id = $this->initGroupRefIdFromQuery();
303 
304  $group_gui = new ilObjGroupGUI("", 0, true);
305  $group_gui->setCreationMode();
306  $form = $group_gui->initForm("create", true);
307  $form->clearCommandButtons();
308  $form->addCommandButton("save", $lng->txt("grp_next"));
309  $form->setShowTopButtons(false);
310  return $form;
311  }
Class ilObjGroupGUI.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
$ref_id
Definition: ltiauth.php:67
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initGroupParentRefIdFromQuery()

ilGroupAddToGroupActionGUI::initGroupParentRefIdFromQuery ( )
protected

Definition at line 62 of file class.ilGroupAddToGroupActionGUI.php.

References $ref_id, ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by createGroup(), and createGroupAndAddUser().

62  : int
63  {
64  $ref_id = 0;
65  if ($this->http->wrapper()->query()->has('grp_act_par_ref_id')) {
66  $ref_id = $this->http->wrapper()->query()->retrieve(
67  'grp_act_par_ref_id',
68  $this->refinery->kindlyTo()->int()
69  );
70  }
71  return $ref_id;
72  }
static http()
Fetches the global http state from ILIAS.
$ref_id
Definition: ltiauth.php:67
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initGroupRefIdFromQuery()

ilGroupAddToGroupActionGUI::initGroupRefIdFromQuery ( )
protected

Definition at line 50 of file class.ilGroupAddToGroupActionGUI.php.

References $ref_id, ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by addUser(), confirmAddUser(), and getGroupCreationForm().

50  : int
51  {
52  $ref_id = 0;
53  if ($this->http->wrapper()->query()->has('grp_act_ref_id')) {
54  $ref_id = $this->http->wrapper()->query()->retrieve(
55  'grp_act_ref_id',
56  $this->refinery->kindlyTo()->int()
57  );
58  }
59  return $ref_id;
60  }
static http()
Fetches the global http state from ILIAS.
$ref_id
Definition: ltiauth.php:67
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initUserIdFromQuery()

ilGroupAddToGroupActionGUI::initUserIdFromQuery ( )
protected

Definition at line 74 of file class.ilGroupAddToGroupActionGUI.php.

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by addUser(), confirmAddUser(), confirmCreateGroupAndAddUser(), and createGroupAndAddUser().

74  : int
75  {
76  $user_id = 0;
77  if ($this->http->wrapper()->query()->has('user_id')) {
78  $user_id = $this->http->wrapper()->query()->retrieve(
79  'user_id',
80  $this->refinery->kindlyTo()->int()
81  );
82  }
83  return $user_id;
84  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ selectGroup()

ilGroupAddToGroupActionGUI::selectGroup ( )

Definition at line 182 of file class.ilGroupAddToGroupActionGUI.php.

References $tree, exit, ilTree\readRootId(), and sendResponse().

182  : void
183  {
184  $tree = $this->tree;
185 
186  $exp = new ilGroupActionTargetExplorerGUI($this, "selectGroup");
187 
188  $exp->setClickableType("grp");
189  $exp->setTypeWhiteList(array("root", "cat", "crs", "fold", "grp"));
190  $exp->setPathOpen($tree->readRootId());
191 
192  if (!$exp->handleCommand()) {
193  $this->sendResponse($exp->getHTML());
194  }
195  exit;
196  }
exit
Definition: login.php:28
+ Here is the call graph for this function:

◆ selectParent()

ilGroupAddToGroupActionGUI::selectParent ( )

Definition at line 262 of file class.ilGroupAddToGroupActionGUI.php.

References $lng, $tree, exit, ilUtil\getSystemMessageHTML(), ilTree\readRootId(), sendResponse(), and ilLanguage\txt().

262  : void
263  {
264  $tree = $this->tree;
265  $lng = $this->lng;
266 
267  $exp = new ilGroupActionTargetExplorerGUI($this, "selectParent", true);
268 
269  $exp->setTypeWhiteList(array("root", "cat", "crs"));
270  $exp->setPathOpen($tree->readRootId());
271 
272  if (!$exp->handleCommand()) {
273  $this->sendResponse(ilUtil::getSystemMessageHTML($lng->txt("grp_no_perm_to_add_create_first")) .
274  $exp->getHTML());
275  }
276 
277  exit;
278  }
exit
Definition: login.php:28
static getSystemMessageHTML(string $a_txt, string $a_type="info")
Get HTML for a system message.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
+ Here is the call graph for this function:

◆ sendResponse()

ilGroupAddToGroupActionGUI::sendResponse ( string  $a_content)

Definition at line 153 of file class.ilGroupAddToGroupActionGUI.php.

References $id, $lng, exit, ILIAS\FileDelivery\http(), ILIAS\Repository\refinery(), ilLanguage\txt(), ILIAS\Repository\ui(), and ILIAS\UI\Implementation\Component\withOnLoadCode().

Referenced by selectGroup(), selectParent(), and show().

153  : void
154  {
155  $lng = $this->lng;
156 
157  $modal_exists = false;
158  if ($this->http->wrapper()->query()->has('modal_exists')) {
159  $modal_exists = (bool) $this->http->wrapper()->query()->retrieve(
160  'modal_exists',
161  $this->refinery->kindlyTo()->int()
162  );
163  }
164  if ($modal_exists) {
165  echo $this->ui->renderer()->renderAsync($this->ui->factory()->legacy($a_content));
166  } else {
167  $mtpl = new ilTemplate("tpl.grp_add_to_grp_modal_content.html", true, true, "./Modules/Group/UserActions");
168  $mtpl->setVariable("CONTENT", $a_content);
169  $content = $this->ui->factory()->legacy($mtpl->get());
170  $modal = $this->ui->factory()->modal()->roundtrip(
171  $lng->txt("grp_add_user_to_group"),
172  $content
173  )->withOnLoadCode(function ($id) {
174  return "il.UI.modal.showModal('$id', {'ajaxRenderUrl':'','keyboard':true}, {id: '$id'});";
175  });
176  echo $this->ui->renderer()->renderAsync($modal);
177  }
178  exit;
179  }
exit
Definition: login.php:28
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static http()
Fetches the global http state from ILIAS.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ show()

ilGroupAddToGroupActionGUI::show ( )

Definition at line 124 of file class.ilGroupAddToGroupActionGUI.php.

References $ctrl, $id, $lng, ilCtrl\getLinkTarget(), ilUtil\getSystemMessageHTML(), sendResponse(), ilLanguage\txt(), ILIAS\Repository\ui(), and ILIAS\UI\Implementation\Component\withOnLoadCode().

124  : void
125  {
126  $lng = $this->lng;
127  $ctrl = $this->ctrl;
128 
129  $toolbar = new ilToolbarGUI();
130 
131  // button use existing group
132  $url1 = $ctrl->getLinkTarget($this, "selectGroup", "", true);
133  $button1 = $this->ui->factory()->button()->standard($lng->txt("grp_use_existing"), "#")
134  ->withOnLoadCode(function ($id) use ($url1) {
135  return "$('#$id').on('click', function() {il.Util.ajaxReplaceInner('$url1', 'il_grp_action_modal_content'); return false;})";
136  });
137  $toolbar->addComponent($button1);
138 
139  // button create new group
140  $url2 = $ctrl->getLinkTarget($this, "selectParent", "", true);
141  $button2 = $this->ui->factory()->button()->standard($lng->txt("grp_create_new"), "#")
142  ->withOnLoadCode(function ($id) use ($url2) {
143  return "$('#$id').on('click', function() {il.Util.ajaxReplaceInner('$url2', 'il_grp_action_modal_content'); return false;})";
144  });
145  $toolbar->addComponent($button2);
146 
147  $this->sendResponse(
148  ilUtil::getSystemMessageHTML($lng->txt("grp_create_or_use_existing"), "question") .
149  $toolbar->getHTML()
150  );
151  }
static getSystemMessageHTML(string $a_txt, string $a_type="info")
Get HTML for a system message.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilGroupAddToGroupActionGUI::$ctrl
protected

Definition at line 19 of file class.ilGroupAddToGroupActionGUI.php.

Referenced by confirmAddUser(), executeCommand(), and show().

◆ $http

GlobalHttpState ilGroupAddToGroupActionGUI::$http
protected

Definition at line 27 of file class.ilGroupAddToGroupActionGUI.php.

◆ $lng

◆ $refinery

Factory ilGroupAddToGroupActionGUI::$refinery
protected

Definition at line 28 of file class.ilGroupAddToGroupActionGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilGroupAddToGroupActionGUI::$tpl
protected

Definition at line 20 of file class.ilGroupAddToGroupActionGUI.php.

◆ $tree

ilTree ilGroupAddToGroupActionGUI::$tree
protected

Definition at line 23 of file class.ilGroupAddToGroupActionGUI.php.

Referenced by selectGroup(), and selectParent().

◆ $ui

UIServices ilGroupAddToGroupActionGUI::$ui
protected

Definition at line 21 of file class.ilGroupAddToGroupActionGUI.php.

◆ $user

ilObjUser ilGroupAddToGroupActionGUI::$user
protected

Definition at line 24 of file class.ilGroupAddToGroupActionGUI.php.

Referenced by executeCommand().


The documentation for this class was generated from the following file: