ILIAS  release_8 Revision v8.24
class.ilGroupEditParticipantsTableGUI.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4/*
5 +-----------------------------------------------------------------------------+
6 | ILIAS open source |
7 +-----------------------------------------------------------------------------+
8 | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
9 | |
10 | This program is free software; you can redistribute it and/or |
11 | modify it under the terms of the GNU General Public License |
12 | as published by the Free Software Foundation; either version 2 |
13 | of the License, or (at your option) any later version. |
14 | |
15 | This program is distributed in the hope that it will be useful, |
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
18 | GNU General Public License for more details. |
19 | |
20 | You should have received a copy of the GNU General Public License |
21 | along with this program; if not, write to the Free Software |
22 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
23 +-----------------------------------------------------------------------------+
24*/
25
26
35{
39
47 public function __construct(object $a_parent_obj, ilObject $rep_object)
48 {
49 global $DIC;
50
51 $this->rep_object = $rep_object;
52
53 $this->privacy = ilPrivacySettings::getInstance();
54 $this->participants = ilGroupParticipants::_getInstanceByObjId($this->rep_object->getId());
55 parent::__construct($a_parent_obj, 'editMembers');
56 $this->lng->loadLanguageModule('grp');
57 $this->setFormName('participants');
58 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
59
60 $this->addColumn($this->lng->txt('name'), 'name', '20%');
61 $this->addColumn($this->lng->txt('login'), 'login', '25%');
62
63 if ($this->privacy->enabledGroupAccessTimes()) {
64 $this->addColumn($this->lng->txt('last_access'), 'access_time');
65 }
66 $this->addColumn($this->lng->txt('grp_mem_contacts'), 'contact');
67 $this->addColumn($this->lng->txt('grp_notification'), 'notification');
68 $this->addColumn($this->lng->txt('objs_role'), 'roles');
69
70 $this->addCommandButton('updateParticipants', $this->lng->txt('save'));
71 $this->addCommandButton('participants', $this->lng->txt('cancel'));
72
73 $this->setRowTemplate("tpl.edit_participants_row.html", "Modules/Group");
74
75 $this->disable('sort');
76 $this->enable('header');
77 $this->enable('numinfo');
78 $this->disable('select_all');
79 }
80
81 protected function fillRow(array $a_set): void
82 {
83 $this->tpl->setVariable('VAL_ID', $a_set['usr_id']);
84 $this->tpl->setVariable('VAL_NAME', $a_set['lastname'] . ', ' . $a_set['firstname']);
85
86 $this->tpl->setVariable('VAL_LOGIN', $a_set['login']);
87
88 if ($this->privacy->enabledGroupAccessTimes()) {
89 $this->tpl->setVariable('VAL_ACCESS', $a_set['access_time']);
90 }
91 $this->tpl->setVariable('VAL_CONTACT_CHECKED', $a_set['contact'] ? 'checked="checked"' : '');
92 $this->tpl->setVariable('VAL_NOTIFICATION_ID', $a_set['usr_id']);
93 $this->tpl->setVariable('VAL_NOTIFICATION_CHECKED', $a_set['notification'] ? 'checked="checked"' : '');
94
95 $this->tpl->setVariable('NUM_ROLES', count($this->participants->getRoles()));
96
97 $assigned = $this->participants->getAssignedRoles((int) $a_set['usr_id']);
98 foreach ($this->rep_object->getLocalGroupRoles(true) as $name => $role_id) {
99 $this->tpl->setCurrentBlock('roles');
100 $this->tpl->setVariable('ROLE_ID', $role_id);
101 $this->tpl->setVariable('ROLE_NAME', $name);
102
103 if (in_array($role_id, $assigned)) {
104 $this->tpl->setVariable('ROLE_CHECKED', 'selected="selected"');
105 }
106 $this->tpl->parseCurrentBlock();
107 }
108 }
109}
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
global $DIC
Definition: feed.php:28
if($format !==null) $name
Definition: metadata.php:247
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc