ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilGroupEditParticipantsTableGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
28{
32
40 public function __construct(object $a_parent_obj, ilObject $rep_object)
41 {
42 global $DIC;
43
44 $this->rep_object = $rep_object;
45
46 $this->privacy = ilPrivacySettings::getInstance();
47 $this->participants = ilGroupParticipants::_getInstanceByObjId($this->rep_object->getId());
48 parent::__construct($a_parent_obj, 'editMembers');
49 $this->lng->loadLanguageModule('grp');
50 $this->setFormName('participants');
51 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
52
53 $this->addColumn($this->lng->txt('name'), 'name', '20%');
54 $this->addColumn($this->lng->txt('login'), 'login', '25%');
55
56 if ($this->privacy->enabledGroupAccessTimes()) {
57 $this->addColumn($this->lng->txt('last_access'), 'access_time');
58 }
59 $this->addColumn($this->lng->txt('grp_mem_contacts'), 'contact');
60 $this->addColumn($this->lng->txt('grp_notification'), 'notification');
61 $this->addColumn($this->lng->txt('objs_role'), 'roles');
62
63 $this->addCommandButton('updateParticipants', $this->lng->txt('save'));
64 $this->addCommandButton('participants', $this->lng->txt('cancel'));
65
66 $this->setRowTemplate("tpl.edit_participants_row.html", "components/ILIAS/Group");
67
68 $this->disable('sort');
69 $this->enable('header');
70 $this->enable('numinfo');
71 $this->disable('select_all');
72 }
73
74 protected function fillRow(array $a_set): void
75 {
76 $this->tpl->setVariable('VAL_ID', $a_set['usr_id']);
77 $this->tpl->setVariable('VAL_NAME', $a_set['lastname'] . ', ' . $a_set['firstname']);
78
79 $this->tpl->setVariable('VAL_LOGIN', $a_set['login']);
80
81 if ($this->privacy->enabledGroupAccessTimes()) {
82 $this->tpl->setVariable('VAL_ACCESS', $a_set['access_time']);
83 }
84 $this->tpl->setVariable('VAL_CONTACT_CHECKED', $a_set['contact'] ? 'checked="checked"' : '');
85 $this->tpl->setVariable('VAL_NOTIFICATION_ID', $a_set['usr_id']);
86 $this->tpl->setVariable('VAL_NOTIFICATION_CHECKED', $a_set['notification'] ? 'checked="checked"' : '');
87
88 $this->tpl->setVariable('NUM_ROLES', count($this->participants->getRoles()));
89
90 $assigned = $this->participants->getAssignedRoles((int) $a_set['usr_id']);
91 foreach ($this->rep_object->getLocalGroupRoles(true) as $name => $role_id) {
92 $this->tpl->setCurrentBlock('roles');
93 $this->tpl->setVariable('ROLE_ID', $role_id);
94 $this->tpl->setVariable('ROLE_NAME', $name);
95
96 if (in_array($role_id, $assigned)) {
97 $this->tpl->setVariable('ROLE_CHECKED', 'selected="selected"');
98 }
99 $this->tpl->parseCurrentBlock();
100 }
101 }
102}
fillRow(array $a_set)
Standard Version of Fill Row.
__construct(object $a_parent_obj, ilObject $rep_object)
Constructor.
static _getInstanceByObjId(int $a_obj_id)
Get singleton instance.
Class ilObject Basic functions for all objects.
Base class for course and group participants.
Singleton class that stores all privacy settings.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setFormName(string $a_name="")
setFormAction(string $a_form_action, bool $a_multipart=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
enable(string $a_module_name)
disable(string $a_module_name)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26