ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilCalendarSharedRoleListTableGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
25{
27 protected array $role_ids = array();
28
29 public function __construct(object $parent_obj, string $parent_cmd)
30 {
31 global $DIC;
32
33 $this->rbacreview = $DIC->rbac()->review();
34
36
37 $this->setRowTemplate('tpl.calendar_shared_role_list_row.html', 'components/ILIAS/Calendar');
38 $this->addColumn('', 'id', '1px');
39 $this->addColumn($this->lng->txt('objs_role'), 'title', '75%');
40 $this->addColumn($this->lng->txt('assigned_members'), 'num', '25%');
41
42 $this->addMultiCommand('shareAssignRoles', $this->lng->txt('cal_share_cal'));
43 $this->addMultiCommand('shareAssignRolesEditable', $this->lng->txt('cal_share_cal_editable'));
44 $this->setSelectAllCheckbox('role_ids');
45 $this->setPrefix('search');
46 }
47
48 public function setRoles(array $a_role_ids): void
49 {
50 $this->role_ids = $a_role_ids;
51 }
52
56 protected function fillRow(array $a_set): void
57 {
58 $this->tpl->setVariable('VAL_ID', $a_set['id']);
59 $this->tpl->setVariable('TITLE', $a_set['title']);
60 if (strlen($a_set['description'])) {
61 $this->tpl->setVariable('DESCRIPTION', $a_set['description']);
62 }
63 $this->tpl->setVariable('NUM_USERS', $a_set['num']);
64 }
65
66 public function parse(): void
67 {
68 $users = $roles = array();
69 foreach ($this->role_ids as $id) {
70 $tmp_data['title'] = ilObject::_lookupTitle($id);
71 $tmp_data['description'] = ilObject::_lookupDescription($id);
72 $tmp_data['id'] = $id;
73 $tmp_data['num'] = count($this->rbacreview->assignedUsers($id));
74
75 $roles[] = $tmp_data;
76 }
77
78 $this->setData($roles);
79 }
80}
__construct(object $parent_obj, string $parent_cmd)
static _lookupTitle(int $obj_id)
static _lookupDescription(int $obj_id)
class ilRbacReview Contains Review functions of core Rbac.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addMultiCommand(string $a_cmd, string $a_text)
setPrefix(string $a_prefix)
set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort...
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)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setData(array $a_data)
Set table data.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26