ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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  private $show_options = true;
23 
28  public function __construct($a_parent_obj, $a_parent_cmd, $a_obj_ref_id, $a_role_id, $a_show_admin_permissions = false)
29  {
30  global $ilCtrl,$rbacreview,$tpl;
31 
32  $this->tpl_type = $a_type;
33  $this->show_admin_permissions = $a_show_admin_permissions;
34 
35  parent::__construct($a_parent_obj, $a_parent_cmd);
36 
37  $this->setId('role_options_' . $a_ref_id . '_' . $a_role_id);
38 
39  $this->lng->loadLanguageModule('rbac');
40 
41  $this->role_id = $a_role_id;
42  $this->obj_ref_id = $a_obj_ref_id;
43 
44 
45  $this->setRowTemplate("tpl.obj_role_template_options_row.html", "Services/AccessControl");
46  $this->setLimit(100);
47  $this->setShowRowsSelector(false);
48  $this->setDisableFilterHiding(true);
49 
50  $this->setEnableHeader(false);
51  $this->disable('sort');
52  $this->disable('numinfo');
53  $this->disable('form');
54 
55  $this->addColumn('', '', '0');
56  $this->addColumn('', '', '100%');
57 
58  $this->setTopCommands(false);
59  }
60 
66  public function setShowOptions($a_status)
67  {
68  $this->show_options = $a_status;
69  }
70 
74  public function getShowOptions()
75  {
76  return $this->show_options;
77  }
78 
79 
84  public function getObjectRefId()
85  {
86  return $this->obj_ref_id;
87  }
88 
93  public function getRoleId()
94  {
95  return $this->role_id;
96  }
97 
98 
103  public function fillRow($row)
104  {
105  global $rbacreview;
106 
107  if (!$this->getShowOptions()) {
108  return true;
109  }
110 
111  if (isset($row['recursive']) and !$this->show_admin_permissions) {
112  $this->tpl->setCurrentBlock('recursive');
113  $this->tpl->setVariable('TXT_RECURSIVE', $this->lng->txt('change_existing_objects'));
114  $this->tpl->setVariable('DESC_RECURSIVE', $this->lng->txt('change_existing_objects_desc'));
115  return true;
116  } elseif ($row['protected']) {
117  $this->tpl->setCurrentBlock('protected');
118 
119  if (!$rbacreview->isAssignable($this->getRoleId(), $this->getObjectRefId())) {
120  $this->tpl->setVariable('DISABLED_PROTECTED', 'disabled="disabled"');
121  }
122 
123  if ($rbacreview->isProtected($this->getObjectRefId(), $this->getRoleId())) {
124  $this->tpl->setVariable('PROTECTED_CHECKED', 'checked="checked"');
125  }
126 
127  $this->tpl->setVariable('TXT_PROTECTED', $this->lng->txt('role_protect_permissions'));
128  $this->tpl->setVariable('DESC_PROTECTED', $this->lng->txt('role_protect_permissions_desc'));
129  $this->tpl->parseCurrentBlock();
130  return true;
131  }
132  }
133 
138  public function parse()
139  {
140  global $rbacreview, $objDefinition;
141 
142  $row[0]['recursive'] = 1;
143  $row[1]['protected'] = 1;
144 
145  $this->setData($row);
146  }
147 }
setId($a_val)
Set id.
global $ilCtrl
Definition: ilias.php:18
$a_type
Definition: workflow.php:92
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
Class ilTable2GUI.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
disable($a_module_name)
diesables particular modules of table
__construct($a_parent_obj, $a_parent_cmd, $a_obj_ref_id, $a_role_id, $a_show_admin_permissions=false)
Constructor.
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.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setEnableHeader($a_enableheader)
Set Enable Header.
setLimit($a_limit=0, $a_default_limit=0)