Add user to group from awareness tool.
More...
Add user to group from awareness tool.
- Author
- Alex Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
Definition at line 11 of file class.ilGroupAddToGroupActionGUI.php.
◆ __construct()
ilGroupAddToGroupActionGUI::__construct |
( |
| ) |
|
Constructor.
- Parameters
-
Definition at line 43 of file class.ilGroupAddToGroupActionGUI.php.
References $DIC, ui(), and user().
47 $this->ctrl = $DIC->ctrl();
48 $this->tpl = $DIC[
"tpl"];
49 $this->
ui = $DIC->ui();
50 $this->lng = $DIC->language();
51 $this->tree = $DIC->repositoryTree();
52 $this->
user = $DIC->user();
54 $this->lng->loadLanguageModule(
"grp");
55 $this->ctrl->saveParameter($this, array(
"user_id",
"modal_exists"));
◆ addUser()
ilGroupAddToGroupActionGUI::addUser |
( |
| ) |
|
◆ confirmAddUser()
ilGroupAddToGroupActionGUI::confirmAddUser |
( |
| ) |
|
Confirm add user to group.
- Parameters
-
Definition at line 191 of file class.ilGroupAddToGroupActionGUI.php.
References $_GET, $ctrl, $lng, $tpl, $url, ilObject\_lookupObjId(), ilObject\_lookupTitle(), exit, ilParticipants\getInstanceByObjId(), ilUserUtil\getNamePresentation(), ilUtil\getSystemMessageHTML(), ui(), and ILIAS\UI\Implementation\Component\withOnLoadCode().
197 include_once(
"./Services/Membership/classes/class.ilParticipants.php");
198 include_once
'./Services/Membership/classes/class.ilParticipants.php';
200 if ($participants->isMember((
int)
$_GET[
"user_id"])) {
201 $url =
$ctrl->getLinkTarget($this,
"selectGroup",
"",
true,
false);
202 $button = $this->
ui->factory()->button()->standard(
$lng->txt(
"back"),
"#")
204 return "$('#$id').on('click', function() {il.Util.ajaxReplaceInner('$url', 'il_grp_action_modal_content'); return false;})";
211 $this->
ui->renderer()->renderAsync($button);
217 $ctrl->setParameter($this,
"grp_act_ref_id", $_GET[
"grp_act_ref_id"]);
218 $url =
$ctrl->getLinkTarget($this,
"addUser",
"",
true,
false);
219 $button = $this->
ui->factory()->button()->standard(
$lng->txt(
"grp_add_user"),
"#")
221 return "$('#$id').on('click', function() {il.Util.ajaxReplaceInner('$url', 'il_grp_action_modal_content'); return false;})";
228 $this->
ui->renderer()->renderAsync($button);
static getSystemMessageHTML($a_txt, $a_type="info")
Get HTML for a system message.
static _lookupTitle($a_id)
lookup object title
static _lookupObjId($a_id)
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
static getInstanceByObjId($a_obj_id)
Get instance by obj type.
withOnLoadCode(\Closure $binder)
◆ confirmCreateGroupAndAddUser()
ilGroupAddToGroupActionGUI::confirmCreateGroupAndAddUser |
( |
| ) |
|
Save group.
- Parameters
-
Definition at line 336 of file class.ilGroupAddToGroupActionGUI.php.
References $_GET, $_POST, $ctrl, $lng, $tpl, createGroup(), exit, getGroupCreationForm(), ilUserUtil\getNamePresentation(), ilUtil\getSystemMessageHTML(), ui(), and ILIAS\UI\Implementation\Component\withOnLoadCode().
343 if (!$form->checkInput()) {
348 $this->ctrl->saveParameter($this,
"grp_act_par_ref_id");
349 $form->setFormAction($this->ctrl->getLinkTarget($this,
"createGroupAndAddUser",
"",
true,
false));
350 $form->setValuesByPost();
352 $button = $this->
ui->factory()->button()->standard(
$lng->txt(
"grp_create_and_add_user"),
"#")
354 return "$('#$id').on('click', function(e) {il.Group.UserActions.createGroup(e);})";
360 $lng->txt(
"obj_grp") .
": " .
$_POST[
"title"],
"question") .
361 "<div class='ilNoDisplay'>" . $form->getHTML() .
"</div>" .
362 "<div class='ilRight'>" . $this->
ui->renderer()->renderAsync($button) .
"</div>";
createGroup($form=null)
Create group.
static getSystemMessageHTML($a_txt, $a_type="info")
Get HTML for a system message.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
withOnLoadCode(\Closure $binder)
◆ createGroup()
ilGroupAddToGroupActionGUI::createGroup |
( |
|
$form = null | ) |
|
Create group.
- Parameters
-
Definition at line 297 of file class.ilGroupAddToGroupActionGUI.php.
References $_GET, $lng, $tpl, ilObject\_lookupObjId(), ilObject\_lookupTitle(), exit, getGroupCreationForm(), and ilUtil\getSystemMessageHTML().
Referenced by confirmCreateGroupAndAddUser().
305 $this->ctrl->saveParameter($this,
"grp_act_par_ref_id");
306 $form->setFormAction($this->ctrl->getLinkTarget($this,
"confirmCreateGroupAndAddUser",
"",
true,
false));
static getSystemMessageHTML($a_txt, $a_type="info")
Get HTML for a system message.
static _lookupTitle($a_id)
lookup object title
static _lookupObjId($a_id)
◆ createGroupAndAddUser()
ilGroupAddToGroupActionGUI::createGroupAndAddUser |
( |
| ) |
|
Create group and add user.
- Parameters
-
Definition at line 373 of file class.ilGroupAddToGroupActionGUI.php.
References $_GET, $lng, $tpl, $url, ilLink\_getLink(), exit, getGroupCreationForm(), ilParticipants\getInstanceByObjId(), ilUtil\getSystemMessageHTML(), IL_GRP_MEMBER, and ilGroupMembershipMailNotification\TYPE_ADMISSION_MEMBER.
378 $user_id = (int)
$_GET[
"user_id"];
386 include_once(
"./Modules/Group/classes/class.ilObjGroup.php");
388 $newObj->setType(
"grp");
389 $newObj->setTitle($form->getInput(
"title"));
390 $newObj->setDescription($form->getInput(
"desc"));
393 $group_gui->putObjectInTree($newObj, (
int)
$_GET[
"grp_act_par_ref_id"]);
396 $dtpl = $group_gui->getDidacticTemplateVar(
"dtpl");
398 $newObj->applyDidacticTemplate($dtpl);
401 $group_gui->afterSave($newObj,
false);
404 include_once
'./Services/Membership/classes/class.ilParticipants.php';
409 include_once
'./Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
410 $participants->sendNotification(
416 include_once(
"./Services/Link/classes/class.ilLink.php");
419 echo
"<script>setTimeout(function (){ window.location.replace('$url');}, 1500);</script>";
static getSystemMessageHTML($a_txt, $a_type="info")
Get HTML for a system message.
const TYPE_ADMISSION_MEMBER
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static getInstanceByObjId($a_obj_id)
Get instance by obj type.
◆ executeCommand()
ilGroupAddToGroupActionGUI::executeCommand |
( |
| ) |
|
Execute command.
Definition at line 61 of file class.ilGroupAddToGroupActionGUI.php.
References $ctrl, and ilGroupUserActionProvider\getCommandAccess().
66 $next_class =
$ctrl->getNextClass($this);
67 $cmd =
$ctrl->getCmd(
"show");
70 include_once(
"./Modules/Group/UserActions/classes/class.ilGroupUserActionProvider.php");
72 if (count($ca) == 0) {
75 if (count($ca) == 1) {
76 switch (current($ca)) {
78 $cmd =
"selectParent";
81 case "manage_members":
91 switch ($next_class) {
93 if (in_array($cmd, array(
"show",
"selectGroup",
"confirmAddUser",
"addUser",
94 "selectParent",
"createGroup",
"confirmCreateGroupAndAddUser",
"createGroupAndAddUser"))) {
95 $ctrl->setParameter($this,
"modal_exists", 1);
static getCommandAccess($a_user_id)
Get command access for user.
◆ getGroupCreationForm()
ilGroupAddToGroupActionGUI::getGroupCreationForm |
( |
| ) |
|
|
protected |
◆ selectGroup()
ilGroupAddToGroupActionGUI::selectGroup |
( |
| ) |
|
Select group.
- Parameters
-
Definition at line 167 of file class.ilGroupAddToGroupActionGUI.php.
References $tree, exit, and sendResponse().
171 include_once(
"./Modules/Group/UserActions/classes/class.ilGroupActionTargetExplorerGUI.php");
174 $exp->setClickableType(
"grp");
175 $exp->setTypeWhiteList(array(
"root",
"cat",
"crs",
"fold",
"grp"));
176 $exp->setPathOpen((
int)
$tree->readRootId());
178 if (!$exp->handleCommand()) {
sendResponse($a_content)
Send response.
◆ selectParent()
ilGroupAddToGroupActionGUI::selectParent |
( |
| ) |
|
Select group.
- Parameters
-
Definition at line 271 of file class.ilGroupAddToGroupActionGUI.php.
References $lng, $tpl, $tree, exit, ilUtil\getSystemMessageHTML(), and sendResponse().
277 include_once(
"./Modules/Group/UserActions/classes/class.ilGroupActionTargetExplorerGUI.php");
280 $exp->setTypeWhiteList(array(
"root",
"cat",
"crs"));
281 $exp->setPathOpen((
int)
$tree->readRootId());
283 if (!$exp->handleCommand()) {
static getSystemMessageHTML($a_txt, $a_type="info")
Get HTML for a system message.
sendResponse($a_content)
Send response.
◆ sendResponse()
ilGroupAddToGroupActionGUI::sendResponse |
( |
|
$a_content | ) |
|
Send response.
- Parameters
-
Definition at line 139 of file class.ilGroupAddToGroupActionGUI.php.
References $_GET, $a_content, $lng, exit, ui(), and ILIAS\UI\Implementation\Component\withOnLoadCode().
Referenced by selectGroup(), selectParent(), and show().
143 if (
$_GET[
"modal_exists"] == 1) {
144 echo $this->
ui->renderer()->renderAsync($this->
ui->factory()->legacy(
$a_content));
146 $mtpl =
new ilTemplate(
"tpl.grp_add_to_grp_modal_content.html",
true,
true,
"./Modules/Group/UserActions");
148 $content = $this->
ui->factory()->legacy($mtpl->get());
149 $modal = $this->
ui->factory()->modal()->roundtrip(
150 $lng->txt(
"grp_add_user_to_group"),
153 return "il.UI.modal.showModal('$id', {'ajaxRenderUrl':'','keyboard':true}, {id: '$id'});";
155 echo $this->
ui->renderer()->renderAsync($modal);
withOnLoadCode(\Closure $binder)
◆ show()
ilGroupAddToGroupActionGUI::show |
( |
| ) |
|
Show.
Definition at line 104 of file class.ilGroupAddToGroupActionGUI.php.
References $ctrl, $lng, $tpl, ilUtil\getSystemMessageHTML(), sendResponse(), ui(), and ILIAS\UI\Implementation\Component\withOnLoadCode().
113 $url1 =
$ctrl->getLinkTarget($this,
"selectGroup",
"",
true,
false);
114 $button1 = $this->
ui->factory()->button()->standard(
$lng->txt(
"grp_use_existing"),
"#")
116 return "$('#$id').on('click', function() {il.Util.ajaxReplaceInner('$url1', 'il_grp_action_modal_content'); return false;})";
118 $toolbar->addComponent($button1);
121 $url2 =
$ctrl->getLinkTarget($this,
"selectParent",
"",
true,
false);
122 $button2 = $this->
ui->factory()->button()->standard(
$lng->txt(
"grp_create_new"),
"#")
124 return "$('#$id').on('click', function() {il.Util.ajaxReplaceInner('$url2', 'il_grp_action_modal_content'); return false;})";
126 $toolbar->addComponent($button2);
static getSystemMessageHTML($a_txt, $a_type="info")
Get HTML for a system message.
sendResponse($a_content)
Send response.
withOnLoadCode(\Closure $binder)
◆ $ctrl
ilGroupAddToGroupActionGUI::$ctrl |
|
protected |
◆ $lng
ilGroupAddToGroupActionGUI::$lng |
|
protected |
◆ $tpl
ilGroupAddToGroupActionGUI::$tpl |
|
protected |
◆ $tree
ilGroupAddToGroupActionGUI::$tree |
|
protected |
◆ $ui
ilGroupAddToGroupActionGUI::$ui |
|
protected |
The documentation for this class was generated from the following file: