ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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
4include_once('./Services/Table/classes/class.ilTable2GUI.php');
5include_once './Services/AccessControl/classes/class.ilPermissionGUI.php';
6
17{
18 private $role_id = null;
19 private $obj_ref_id = null;
20
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 $DIC;
31
32 $ilCtrl = $DIC['ilCtrl'];
33 $rbacreview = $DIC['rbacreview'];
34 $tpl = $DIC['tpl'];
35
36 $this->tpl_type = $a_type;
37 $this->show_admin_permissions = $a_show_admin_permissions;
38
39 parent::__construct($a_parent_obj, $a_parent_cmd);
40
41 $this->setId('role_options_' . $a_ref_id . '_' . $a_role_id);
42
43 $this->lng->loadLanguageModule('rbac');
44
45 $this->role_id = $a_role_id;
46 $this->obj_ref_id = $a_obj_ref_id;
47
48
49 $this->setRowTemplate("tpl.obj_role_template_options_row.html", "Services/AccessControl");
50 $this->setLimit(100);
51 $this->setShowRowsSelector(false);
52 $this->setDisableFilterHiding(true);
53
54 $this->setEnableHeader(false);
55 $this->disable('sort');
56 $this->disable('numinfo');
57 $this->disable('form');
58
59 $this->addColumn('', '', '0');
60 $this->addColumn('', '', '100%');
61
62 $this->setTopCommands(false);
63 }
64
70 public function setShowOptions($a_status)
71 {
72 $this->show_options = $a_status;
73 }
74
78 public function getShowOptions()
79 {
81 }
82
83
88 public function getObjectRefId()
89 {
90 return $this->obj_ref_id;
91 }
92
97 public function getRoleId()
98 {
99 return $this->role_id;
100 }
101
102
107 public function fillRow($row)
108 {
109 global $DIC;
110
111 $rbacreview = $DIC['rbacreview'];
112
113
114 if (!$this->getShowOptions()) {
115 return true;
116 }
117
118 if (isset($row['recursive']) and !$this->show_admin_permissions) {
119 $this->tpl->setCurrentBlock('recursive');
120 $this->tpl->setVariable('TXT_RECURSIVE', $this->lng->txt('change_existing_objects'));
121 $this->tpl->setVariable('DESC_RECURSIVE', $this->lng->txt('change_existing_objects_desc'));
122 return true;
123 } elseif ($row['protected']) {
124 $this->tpl->setCurrentBlock('protected');
125
126 if (!$rbacreview->isAssignable($this->getRoleId(), $this->getObjectRefId())) {
127 $this->tpl->setVariable('DISABLED_PROTECTED', 'disabled="disabled"');
128 }
129
130 if ($rbacreview->isProtected($this->getObjectRefId(), $this->getRoleId())) {
131 $this->tpl->setVariable('PROTECTED_CHECKED', 'checked="checked"');
132 }
133
134 $this->tpl->setVariable('TXT_PROTECTED', $this->lng->txt('role_protect_permissions'));
135 $this->tpl->setVariable('DESC_PROTECTED', $this->lng->txt('role_protect_permissions_desc'));
136 $this->tpl->parseCurrentBlock();
137 return true;
138 }
139 }
140
145 public function parse()
146 {
147 global $DIC;
148
149 $rbacreview = $DIC['rbacreview'];
150 $objDefinition = $DIC['objDefinition'];
151
152 $row[0]['recursive'] = 1;
153 $row[1]['protected'] = 1;
154
155 $this->setData($row);
156 }
157}
An exception for terminatinating execution or to throw for unit testing.
__construct($a_parent_obj, $a_parent_cmd, $a_obj_ref_id, $a_role_id, $a_show_admin_permissions=false)
Constructor.
Class ilTable2GUI.
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
setEnableHeader($a_enableheader)
Set Enable Header.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setLimit($a_limit=0, $a_default_limit=0)
set max.
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.
setId($a_val)
Set id.
disable($a_module_name)
diesables particular modules of table
global $ilCtrl
Definition: ilias.php:18
$row
global $DIC
Definition: saml.php:7
$a_type
Definition: workflow.php:92