ILIAS  release_8 Revision v8.24
class.ilCalendarSharedUserListTableGUI.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
32{
33 protected array $user_ids = array();
34
35 public function __construct(object $parent_obj, string $parent_cmd)
36 {
38
39 $this->setRowTemplate('tpl.calendar_shared_user_list_row.html', 'Services/Calendar');
40
41 $this->addColumn('', 'id', '1px');
42 $this->addColumn($this->lng->txt('name'), 'last_firstname', '60%');
43 $this->addColumn($this->lng->txt('login'), 'login', '40%');
44
45 $this->addMultiCommand('shareAssign', $this->lng->txt('cal_share_cal'));
46 $this->addMultiCommand('shareAssignEditable', $this->lng->txt('cal_share_cal_editable'));
47 $this->setSelectAllCheckbox('user_ids');
48 $this->setPrefix('search');
49 }
50
51 public function setUsers(array $a_user_ids)
52 {
53 $this->user_ids = $a_user_ids;
54 }
55
56 protected function fillRow(array $a_set): void
57 {
58 $this->tpl->setVariable('VAL_ID', $a_set['id']);
59
60 $this->tpl->setVariable('LASTNAME', $a_set['lastname']);
61 $this->tpl->setVariable('FIRSTNAME', $a_set['firstname']);
62 $this->tpl->setVariable('LOGIN', $a_set['login']);
63 }
64
65 public function parse(): void
66 {
67 $users = array();
68 foreach ($this->user_ids as $id) {
69 $id = (int) $id;
71
72 $tmp_data['id'] = $id;
73 $tmp_data['lastname'] = $name['lastname'];
74 $tmp_data['firstname'] = $name['firstname'];
75 $tmp_data['login'] = ilObjUser::_lookupLogin($id);
76 $tmp_data['last_firstname'] = $tmp_data['lastname'] . $tmp_data['firstname'] . $tmp_data['login'];
77
78 $users[] = $tmp_data;
79 }
80 $this->setData($users);
81 }
82}
__construct(object $parent_obj, string $parent_cmd)
fillRow(array $a_set)
Standard Version of Fill Row.
static _lookupName(int $a_user_id)
lookup user name
static _lookupLogin(int $a_user_id)
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.
if($format !==null) $name
Definition: metadata.php:247
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc