ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilCalendarSharedRoleListTableGUI.php
Go to the documentation of this file.
1<?php
2/*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2006 ILIAS open source, University of Cologne |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 +-----------------------------------------------------------------------------+
22*/
23
24include_once('./Services/Table/classes/class.ilTable2GUI.php');
25
26
36{
37 protected $role_ids = array();
38
48 {
50
51 $this->setRowTemplate('tpl.calendar_shared_role_list_row.html', 'Services/Calendar');
52
53 $this->addColumn('', 'id', '1px');
54 $this->addColumn($this->lng->txt('objs_role'), 'title', '75%');
55 $this->addColumn($this->lng->txt('assigned_members'), 'num', '25%');
56
57 $this->addMultiCommand('shareAssignRoles', $this->lng->txt('cal_share_cal'));
58 $this->addMultiCommand('shareAssignRolesEditable', $this->lng->txt('cal_share_cal_editable'));
59 $this->setSelectAllCheckbox('role_ids');
60 $this->setPrefix('search');
61 }
62
70 public function setRoles($a_role_ids)
71 {
72 $this->role_ids = $a_role_ids;
73 }
74
81 public function fillRow($a_set)
82 {
83 $this->tpl->setVariable('VAL_ID', $a_set['id']);
84
85 $this->tpl->setVariable('TITLE', $a_set['title']);
86 if (strlen($a_set['description'])) {
87 $this->tpl->setVariable('DESCRIPTION', $a_set['description']);
88 }
89 $this->tpl->setVariable('NUM_USERS', $a_set['num']);
90 }
91
92
99 public function parse()
100 {
101 global $DIC;
102
103 $rbacreview = $DIC['rbacreview'];
104
105 $users = array();
106 foreach ($this->role_ids as $id) {
107 $tmp_data['title'] = ilObject::_lookupTitle($id);
108 $tmp_data['description'] = ilObject::_lookupDescription($id);
109 $tmp_data['id'] = $id;
110 $tmp_data['num'] = count($rbacreview->assignedUsers($id));
111
112 $roles[] = $tmp_data;
113 }
114
115 $this->setData($roles ? $roles : array());
116 }
117}
An exception for terminatinating execution or to throw for unit testing.
__construct($parent_obj, $parent_cmd)
Constructor.
static _lookupTitle($a_id)
lookup object title
static _lookupDescription($a_id)
lookup object description
Class ilTable2GUI.
setPrefix($a_prefix)
set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort...
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
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.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc