ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilRoleSelectionTableGUI.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 
36 {
37 
44  public function __construct($a_parent_obj,$a_parent_cmd)
45  {
46  global $lng,$ilCtrl;
47 
48  $this->lng = $lng;
49  $this->ctrl = $ilCtrl;
50 
51  parent::__construct($a_parent_obj,$a_parent_cmd);
52  $this->addColumn('','f',1);
53  $this->addColumn($this->lng->txt('title'),'title',"70%");
54  $this->addColumn($this->lng->txt('context'),'context',"30%");
55 
56  $this->setFormAction($this->ctrl->getFormAction($a_parent_obj));
57  $this->setRowTemplate("tpl.show_role_selection_row.html","Services/AccessControl");
58  $this->setDefaultOrderField('type');
59  $this->setDefaultOrderDirection("desc");
60  }
61 
62 
70  public function fillRow($a_set)
71  {
72  $this->tpl->setVariable('VAL_ID',$a_set['id']);
73  $this->tpl->setVariable('VAL_TITLE',$a_set['title']);
74  if(strlen($a_set['description']))
75  {
76  $this->tpl->setVariable('VAL_DESC',$a_set['description']);
77  }
78 
79  $this->tpl->setVariable('VAL_CONTEXT',$a_set['context']);
80  }
81 
82 
90  public function parse($entries)
91  {
92  global $rbacreview;
93 
94  include_once './Services/AccessControl/classes/class.ilObjRole.php';
95  foreach($entries as $entry)
96  {
97  $tmp_arr['id'] = $entry['obj_id'];
98  $tmp_arr['title'] = ilObjRole::_getTranslation(ilObject::_lookupTitle($entry['obj_id']));
99  $tmp_arr['description'] = ilObject::_lookupDescription($entry['obj_id']);
100  $tmp_arr['context'] = ilObject::_lookupTitle($rbacreview->getObjectOfRole($entry['obj_id']));
101 
102  $records_arr[] = $tmp_arr;
103  }
104 
105  $this->setData($records_arr ? $records_arr : array());
106  }
107 
108 }
109 ?>