ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilObjectRoleTemplateOptionsTableGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once ('./Services/Table/classes/class.ilTable2GUI.php');
5 include_once './Services/AccessControl/classes/class.ilPermissionGUI.php';
6 
17 {
18  private $role_id = null;
19  private $obj_ref_id = null;
20 
21  private $show_admin_permissions = true;
22 
27  public function __construct($a_parent_obj,$a_parent_cmd, $a_obj_ref_id,$a_role_id,$a_show_admin_permissions = false)
28  {
29  global $ilCtrl,$rbacreview,$tpl;
30 
31  $this->tpl_type = $a_type;
32  $this->show_admin_permissions = $a_show_admin_permissions;
33 
34  parent::__construct($a_parent_obj,$a_parent_cmd);
35 
36  $this->setId('role_options_'.$a_ref_id.'_'.$a_role_id);
37 
38  $this->lng->loadLanguageModule('rbac');
39 
40  $this->role_id = $a_role_id;
41  $this->obj_ref_id = $a_obj_ref_id;
42 
43 
44  $this->setRowTemplate("tpl.obj_role_template_options_row.html", "Services/AccessControl");
45  $this->setLimit(100);
46  $this->setShowRowsSelector(false);
47  $this->setDisableFilterHiding(true);
48 
49  $this->setEnableHeader(false);
50  $this->disable('sort');
51  $this->disable('numinfo');
52  $this->disable('form');
53 
54  $this->addColumn('','','0');
55  $this->addColumn('','','100%');
56 
57  $this->setTopCommands(false);
58  }
59 
60 
65  public function getObjectRefId()
66  {
67  return $this->obj_ref_id;
68  }
69 
74  public function getRoleId()
75  {
76  return $this->role_id;
77  }
78 
79 
84  public function fillRow($row)
85  {
86  global $rbacreview;
87 
88  if(isset($row['recursive']) and !$this->show_admin_permissions)
89  {
90  $this->tpl->setCurrentBlock('recursive');
91  $this->tpl->setVariable('TXT_RECURSIVE',$this->lng->txt('change_existing_objects'));
92  $this->tpl->setVariable('DESC_RECURSIVE',$this->lng->txt('change_existing_objects_desc'));
93  return true;
94  }
95  elseif($row['protected'])
96  {
97  $this->tpl->setCurrentBlock('protected');
98 
99  if(!$rbacreview->isAssignable($this->getRoleId(), $this->getObjectRefId()))
100  {
101  $this->tpl->setVariable('DISABLED_PROTECTED','disabled="disabled"');
102  }
103 
104  if($rbacreview->isProtected($this->getObjectRefId(), $this->getRoleId()))
105  {
106  $this->tpl->setVariable('PROTECTED_CHECKED','checked="checked"');
107  }
108 
109  $this->tpl->setVariable('TXT_PROTECTED',$this->lng->txt('role_protect_permissions'));
110  $this->tpl->setVariable('DESC_PROTECTED',$this->lng->txt('role_protect_permissions_desc'));
111  $this->tpl->parseCurrentBlock();
112  return true;
113  }
114  }
115 
120  public function parse()
121  {
122  global $rbacreview, $objDefinition;
123 
124  $row[0]['recursive'] = 1;
125  $row[1]['protected'] = 1;
126 
127  $this->setData($row);
128 
129  }
130 }
131 ?>