19 declare(strict_types=1);
50 $this->
ctrl = $DIC->ctrl();
51 $this->tpl = $DIC->ui()->mainTemplate();
52 $this->
ui = $DIC->ui();
53 $this->
lng = $DIC->language();
54 $this->tree = $DIC->repositoryTree();
55 $this->
user = $DIC->user();
56 $this->
http = $DIC->http();
60 $this->
lng->loadLanguageModule(
"grp");
61 $this->
ctrl->saveParameter($this, array(
"user_id",
"modal_exists"));
67 if ($this->
http->wrapper()->query()->has(
'grp_act_ref_id')) {
68 $ref_id = $this->
http->wrapper()->query()->retrieve(
79 if ($this->
http->wrapper()->query()->has(
'grp_act_par_ref_id')) {
80 $ref_id = $this->
http->wrapper()->query()->retrieve(
91 if ($this->
http->wrapper()->query()->has(
'user_id')) {
106 $cmd = $ctrl->
getCmd(
"show");
108 if ($cmd ==
"show") {
110 if (count($ca) == 0) {
113 if (count($ca) == 1) {
114 switch (current($ca)) {
116 $cmd =
"selectParent";
119 case "manage_members":
120 $cmd =
"selectGroup";
129 switch ($next_class) {
131 if (in_array($cmd, array(
"show",
"selectGroup",
"confirmAddUser",
"addUser",
132 "selectParent",
"createGroup",
"confirmCreateGroupAndAddUser",
"createGroupAndAddUser"))) {
146 $url1 = $ctrl->
getLinkTarget($this,
"selectGroup",
"",
true);
147 $button1 = $this->
ui->factory()->button()->standard($lng->
txt(
"grp_use_existing"),
"#")
149 return "$('#$id').on('click', function() {il.repository.core.fetchReplaceInner( document.getElementById('il_grp_action_modal_content'),'$url1'); return false;})";
151 $toolbar->addComponent($button1);
154 $url2 = $ctrl->
getLinkTarget($this,
"selectParent",
"",
true);
155 $button2 = $this->
ui->factory()->button()->standard($lng->
txt(
"grp_create_new"),
"#")
157 return "$('#$id').on('click', function() {il.repository.core.fetchReplaceInner( document.getElementById('il_grp_action_modal_content'),'$url2'); return false;})";
159 $toolbar->addComponent($button2);
171 $modal_exists =
false;
172 if ($this->
http->wrapper()->query()->has(
'modal_exists')) {
173 $modal_exists = (bool) $this->
http->wrapper()->query()->retrieve(
179 echo $this->
ui->renderer()->renderAsync($this->
ui->factory()->legacy()->content($a_content));
181 $mtpl =
new ilTemplate(
"tpl.grp_add_to_grp_modal_content.html",
true,
true,
"./components/ILIAS/Group/UserActions");
182 $mtpl->setVariable(
"CONTENT", $a_content);
183 $content = $this->
ui->factory()->legacy()->content($mtpl->get());
184 $modal = $this->
ui->factory()->modal()->roundtrip(
185 $lng->
txt(
"grp_add_user_to_group"),
188 return "il.UI.modal.showModal(document.getElementById('$id'), {'ajaxRenderUrl':'','keyboard':true}, {id: '$id'});";
190 echo $this->
ui->renderer()->renderAsync($modal);
202 $exp->setClickableType(
"grp");
203 $exp->setTypeWhiteList(array(
"root",
"cat",
"crs",
"fold",
"grp"));
206 if (!$exp->handleCommand()) {
220 if ($participants->isMember(
$user_id)) {
222 $button = $this->
ui->factory()->button()->standard($lng->
txt(
"back"),
"#")
224 return "$('#$id').on('click', function() {il.repository.core.fetchReplaceInner( document.getElementById('il_grp_action_modal_content'),'$url'); return false;})";
231 $this->
ui->renderer()->renderAsync($button);
239 $button = $this->
ui->factory()->button()->standard($lng->
txt(
"grp_add_user"),
"#")
241 return "$('#$id').on('click', function() {il.repository.core.fetchReplaceInner( document.getElementById('il_grp_action_modal_content'),'$url'); return false;})";
248 $this->
ui->renderer()->renderAsync($button);
266 $participants->sendNotification(
272 echo
"<script>setTimeout(function (){ il.Group.UserActions.closeModal();}, 1000);</script>";
283 $exp->setTypeWhiteList(array(
"root",
"cat",
"crs"));
286 if (!$exp->handleCommand()) {
303 $this->
ctrl->saveParameter($this,
"grp_act_par_ref_id");
304 $form->setFormAction($this->
ctrl->getLinkTarget($this,
"confirmCreateGroupAndAddUser",
"",
true));
319 $group_gui->setCreationMode();
320 $form = $group_gui->initForm(
"create",
true);
321 $form->clearCommandButtons();
322 $form->addCommandButton(
"save", $lng->
txt(
"grp_next"));
323 $form->setShowTopButtons(
false);
333 if ($this->
http->wrapper()->post()->has(
'title')) {
334 $title = $this->
http->wrapper()->post()->retrieve(
336 $this->
refinery->kindlyTo()->string()
343 if (!$form->checkInput()) {
348 $this->
ctrl->saveParameter($this,
"grp_act_par_ref_id");
349 $form->setFormAction($this->
ctrl->getLinkTarget($this,
"createGroupAndAddUser",
"",
true));
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") .
": " . $title,
"question") .
361 "<div class='ilNoDisplay'>" . $form->getHTML() .
"</div>" .
362 "<div class='ilRight'>" . $this->
ui->renderer()->renderAsync($button) .
"</div>";
381 $newObj->setType(
"grp");
382 $newObj->setTitle($form->getInput(
"title"));
383 $newObj->setDescription($form->getInput(
"desc"));
386 $group_gui->putObjectInTree($newObj,
$ref_id);
387 $group_gui =
new ilObjGroupGUI(
"", $group_gui->getRefId(),
true);
391 $type =
'didactic_type';
393 if ($this->
http->wrapper()->post()->has(
'didactic_type')) {
394 $var = $this->
http->wrapper()->post()->retrieve(
396 $this->
refinery->kindlyTo()->string()
399 if (substr($var, 0, strlen($type) + 1) != $type .
"_") {
402 $dtpl = (
int) substr($var, strlen($type) + 1);
406 $newObj->applyDidacticTemplate($dtpl);
409 $group_gui->afterSave($newObj,
false);
416 $participants->sendNotification(
422 $url = ilLink::_getLink($newObj->getRefId());
424 echo
"<script>setTimeout(function (){ window.location.replace('$url');}, 1500);</script>";
ilGlobalTemplateInterface $tpl
static getCommandAccess(int $a_user_id)
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...
Add user to group from awareness tool.
static getInstanceByObjId(int $a_obj_id)
Get instance by obj type.
getCmd(?string $fallback_command=null)
getLinkTarget(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
confirmCreateGroupAndAddUser()
initGroupRefIdFromQuery()
withOnLoadCode(Closure $binder)
static _lookupObjId(int $ref_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Provides fluid interface to RBAC services.
getNextClass($a_gui_class=null)
static http()
Fetches the global http state from ILIAS.
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:
static _lookupTitle(int $obj_id)
sendResponse(string $a_content)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
const TYPE_ADMISSION_MEMBER
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
initGroupParentRefIdFromQuery()
exit
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...