ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilLearningSequenceEditParticipantsTableGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
27
28 public function __construct(
33 ) {
34 parent::__construct($parent_gui, 'editMembers');
35
36 $this->parent_gui = $parent_gui;
37 $this->ls_object = $ls_object;
38 $this->ls_participants = $ls_participants;
39 $this->privacy_settings = $privacy_settings;
40
41 $this->setFormName('participants');
42 $this->setFormAction($this->ctrl->getFormAction($parent_gui));
43 $this->setRowTemplate("tpl.edit_participants_row.html", "components/ILIAS/LearningSequence");
44
45 $this->addColumn($this->lng->txt('name'), 'name', '20%');
46 $this->addColumn($this->lng->txt('login'), 'login', '25%');
47 $this->addColumn($this->lng->txt('lso_notification'), 'notification');
48 $this->addColumn($this->lng->txt('objs_role'), 'roles');
49
50 if ($this->privacy_settings->enabledLearningSequenceAccessTimes()) {
51 $this->addColumn($this->lng->txt('last_access'), 'access_time');
52 }
53
54 $this->addCommandButton('updateParticipants', $this->lng->txt('save'));
55 $this->addCommandButton('participants', $this->lng->txt('cancel'));
56
57 $this->disable('sort');
58 $this->enable('header');
59 $this->enable('numinfo');
60 $this->disable('select_all');
61 }
62
63 protected function fillRow(array $a_set): void
64 {
65 $this->tpl->setVariable('VAL_ID', $a_set['usr_id']);
66 $this->tpl->setVariable('VAL_NAME', $a_set['lastname'] . ', ' . $a_set['firstname']);
67 $this->tpl->setVariable('VAL_LOGIN', $a_set['login']);
68 $this->tpl->setVariable('VAL_NOTIFICATION_ID', $a_set['usr_id']);
69 $this->tpl->setVariable('VAL_NOTIFICATION_CHECKED', $a_set['notification'] ? 'checked="checked"' : '');
70 $this->tpl->setVariable('NUM_ROLES', count($this->ls_participants->getRoles()));
71
72 if ($this->privacy_settings->enabledLearningSequenceAccessTimes()) {
73 $this->tpl->setVariable('VAL_ACCESS', $a_set['access_time']);
74 }
75
76 $assigned = $this->ls_participants->getAssignedRoles((int) $a_set['usr_id']);
77 foreach ($this->ls_object->getLocalLearningSequenceRoles(true) as $name => $role_id) {
78 $this->tpl->setCurrentBlock('roles');
79 $this->tpl->setVariable('ROLE_ID', $role_id);
80 $this->tpl->setVariable('ROLE_NAME', $name);
81
82 if (in_array($role_id, $assigned)) {
83 $this->tpl->setVariable('ROLE_CHECKED', 'selected="selected"');
84 }
85
86 $this->tpl->parseCurrentBlock();
87 }
88 }
89}
__construct(ilLearningSequenceMembershipGUI $parent_gui, ilObjLearningSequence $ls_object, ilLearningSequenceParticipants $ls_participants, ilPrivacySettings $privacy_settings)
GUI class for learning sequence membership features.
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