ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilCalendarSharedUserListTableGUI.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 
24 include_once('./Services/Table/classes/class.ilTable2GUI.php');
25 
26 
36 {
37  protected $user_ids = array();
38 
47  public function __construct($parent_obj,$parent_cmd)
48  {
49  parent::__construct($parent_obj,$parent_cmd);
50 
51  $this->setRowTemplate('tpl.calendar_shared_user_list_row.html','Services/Calendar');
52 
53  $this->addColumn('','id','1px');
54  $this->addColumn($this->lng->txt('name'),'last_firstname','60%');
55  $this->addColumn($this->lng->txt('login'),'login','40%');
56 
57  $this->addMultiCommand('shareAssign',$this->lng->txt('cal_share_cal'));
58  $this->addMultiCommand('shareAssignEditable',$this->lng->txt('cal_share_cal_editable'));
59  $this->setSelectAllCheckbox('user_ids');
60  $this->setPrefix('search');
61  }
62 
70  public function setUsers($a_user_ids)
71  {
72  $this->user_ids = $a_user_ids;
73  }
74 
81  public function fillRow($a_set)
82  {
83  $this->tpl->setVariable('VAL_ID',$a_set['id']);
84 
85  $this->tpl->setVariable('LASTNAME',$a_set['lastname']);
86  $this->tpl->setVariable('FIRSTNAME',$a_set['firstname']);
87  $this->tpl->setVariable('LOGIN',$a_set['login']);
88  }
89 
90 
97  public function parse()
98  {
99 
100  $users = array();
101  foreach($this->user_ids as $id)
102  {
103  $name = ilObjUser::_lookupName($id);
104 
105  $tmp_data['id'] = $id;
106  $tmp_data['lastname'] = $name['lastname'];
107  $tmp_data['firstname'] = $name['firstname'];
108  $tmp_data['login'] = ilObjUser::_lookupLogin($id);
109  $tmp_data['last_firstname'] = $tmp_data['lastname'].$tmp_data['firstname'].$tmp_data['login'];
110 
111  $users[] = $tmp_data;
112  }
113 
114  $this->setData($users ? $users : array());
115  }
116 
117 
118 }
119 ?>
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
Class ilTable2GUI.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setPrefix($a_prefix)
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
__construct($parent_obj, $parent_cmd)
Constructor.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all 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.