ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilLearningSequenceEditParticipantsTableGUI.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
9 {
13  protected $parent_gui;
14 
18  protected $ls_object;
19 
23  protected $ls_participants;
24 
28  protected $privacy_settings;
29 
33  protected $lng;
34 
38  protected $ctrl;
39 
40  public function __construct(
47  ) {
48  parent::__construct($parent_gui, 'editMembers');
49 
50  $this->parent_gui = $parent_gui;
51  $this->ls_object = $ls_object;
52  $this->ls_participants = $ls_participants;
53  $this->privacy_settings = $privacy_settings;
54  $this->lng = $lng;
55  $this->ctrl = $ctrl;
56 
57  $this->setFormName('participants');
58  $this->setFormAction($this->ctrl->getFormAction($parent_gui));
59  $this->setRowTemplate("tpl.edit_participants_row.html", "Modules/LearningSequence");
60 
61  $this->addColumn($this->lng->txt('name'), 'name', '20%');
62  $this->addColumn($this->lng->txt('login'), 'login', '25%');
63  $this->addColumn($this->lng->txt('lso_notification'), 'notification');
64  $this->addColumn($this->lng->txt('objs_role'), 'roles');
65 
66  if ($this->privacy_settings->enabledLearningSequenceAccessTimes()) {
67  $this->addColumn($this->lng->txt('last_access'), 'access_time');
68  }
69 
70  $this->addCommandButton('updateParticipants', $this->lng->txt('save'));
71  $this->addCommandButton('participants', $this->lng->txt('cancel'));
72 
73  $this->disable('sort');
74  $this->enable('header');
75  $this->enable('numinfo');
76  $this->disable('select_all');
77  }
78 
79  public function fillRow($set)
80  {
81  $this->tpl->setVariable('VAL_ID', $set['usr_id']);
82  $this->tpl->setVariable('VAL_NAME', $set['lastname'] . ', ' . $set['firstname']);
83  $this->tpl->setVariable('VAL_LOGIN', $set['login']);
84  $this->tpl->setVariable('VAL_NOTIFICATION_ID', $set['usr_id']);
85  $this->tpl->setVariable('VAL_NOTIFICATION_CHECKED', $set['notification'] ? 'checked="checked"' : '');
86  $this->tpl->setVariable('NUM_ROLES', count($this->ls_participants->getRoles()));
87 
88  if ($this->privacy_settings->enabledLearningSequenceAccessTimes()) {
89  $this->tpl->setVariable('VAL_ACCESS', $set['access_time']);
90  }
91 
92  $assigned = $this->ls_participants->getAssignedRoles($set['usr_id']);
93  foreach ($this->ls_object->getLocalLearningSequenceRoles(true) as $name => $role_id) {
94  $this->tpl->setCurrentBlock('roles');
95  $this->tpl->setVariable('ROLE_ID', $role_id);
96  $this->tpl->setVariable('ROLE_NAME', $name);
97 
98  if (in_array($role_id, $assigned)) {
99  $this->tpl->setVariable('ROLE_CHECKED', 'selected="selected"');
100  }
101 
102  $this->tpl->parseCurrentBlock();
103  }
104  }
105 }
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
This class provides processing control methods.
Class ilObjLearningSequence.
Class ilTable2GUI.
Singleton class that stores all privacy settings.
__construct(ilLearningSequenceMembershipGUI $parent_gui, ilObjLearningSequence $ls_object, ilLearningSequenceParticipants $ls_participants, ilPrivacySettings $privacy_settings, ilLanguage $lng, ilCtrl $ctrl)
enable($a_module_name)
enables particular modules of table
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
setFormName($a_formname="")
Set Form name.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
language handling
GUI class for learning sequence membership features.