ILIAS  release_8 Revision v8.24
class.ilCalendarSharedRoleListTableGUI.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
31{
33 protected array $role_ids = array();
34
35 public function __construct(object $parent_obj, string $parent_cmd)
36 {
37 global $DIC;
38
39 $this->rbacreview = $DIC->rbac()->review();
40
42
43 $this->setRowTemplate('tpl.calendar_shared_role_list_row.html', 'Services/Calendar');
44 $this->addColumn('', 'id', '1px');
45 $this->addColumn($this->lng->txt('objs_role'), 'title', '75%');
46 $this->addColumn($this->lng->txt('assigned_members'), 'num', '25%');
47
48 $this->addMultiCommand('shareAssignRoles', $this->lng->txt('cal_share_cal'));
49 $this->addMultiCommand('shareAssignRolesEditable', $this->lng->txt('cal_share_cal_editable'));
50 $this->setSelectAllCheckbox('role_ids');
51 $this->setPrefix('search');
52 }
53
54 public function setRoles(array $a_role_ids): void
55 {
56 $this->role_ids = $a_role_ids;
57 }
58
62 protected function fillRow(array $a_set): void
63 {
64 $this->tpl->setVariable('VAL_ID', $a_set['id']);
65 $this->tpl->setVariable('TITLE', $a_set['title']);
66 if (strlen($a_set['description'])) {
67 $this->tpl->setVariable('DESCRIPTION', $a_set['description']);
68 }
69 $this->tpl->setVariable('NUM_USERS', $a_set['num']);
70 }
71
72 public function parse(): void
73 {
74 $users = $roles = array();
75 foreach ($this->role_ids as $id) {
76 $tmp_data['title'] = ilObject::_lookupTitle($id);
77 $tmp_data['description'] = ilObject::_lookupDescription($id);
78 $tmp_data['id'] = $id;
79 $tmp_data['num'] = count($this->rbacreview->assignedUsers($id));
80
81 $roles[] = $tmp_data;
82 }
83
84 $this->setData($roles);
85 }
86}
__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.
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc