4 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
5 include_once
'./Services/AccessControl/classes/class.ilPermissionGUI.php';
6 require_once(
'./Services/Repository/classes/class.ilObjectPlugin.php');
35 public function __construct($a_parent_obj, $a_parent_cmd, $a_ref_id, $a_role_id,
$a_type, $a_show_admin_permissions =
false)
40 $this->show_admin_permissions = $a_show_admin_permissions;
42 parent::__construct($a_parent_obj, $a_parent_cmd);
44 $this->
setId(
'role_template_' . $a_ref_id .
'_' .
$a_type);
48 $this->lng->loadLanguageModule(
'rbac');
50 $this->ref_id = $a_ref_id;
51 $this->role_id = $a_role_id;
53 $this->
setRowTemplate(
"tpl.obj_role_template_perm_row.html",
"Services/AccessControl");
75 $this->show_change_existing_objects = $a_status;
94 if (self::$template_permissions !== null) {
97 self::$template_permissions = $rbacreview->getAllOperationsOfRole(
110 return self::$template_permissions[
$a_type] ? self::$template_permissions[
$a_type] :
array();
173 global $objDefinition;
175 if (isset(
$row[
'show_ce'])) {
176 $this->tpl->setCurrentBlock(
'ce_td');
178 $this->tpl->parseCurrentBlock();
180 $this->tpl->setCurrentBlock(
'ce_desc_td');
182 $this->tpl->setVariable(
'CE_LONG', $this->lng->txt(
'change_existing_object_type_desc'));
184 if ($objDefinition->isSystemObject($this->getTemplateType())) {
185 $this->tpl->setVariable(
187 $this->lng->txt(
"change_existing_prefix_single") .
" " .
189 $this->lng->txt(
"change_existing_suffix_single")
197 : $this->lng->txt(
'objs_' . $this->getTemplateType());
198 $this->tpl->setVariable(
200 $this->lng->txt(
'change_existing_prefix') .
' ' .
202 $this->lng->txt(
'change_existing_suffix')
204 $this->tpl->parseCurrentBlock();
208 $this->tpl->setCurrentBlock(
'perm_td');
210 $this->tpl->setVariable(
'PERM_PERM_ID',
$row[
'ops_id']);
211 $this->tpl->setVariable(
'PERM_CHECKED',
$row[
'set'] ?
'checked="checked"' :
'');
213 if ($this->
getRoleId() == SYSTEM_ROLE_ID) {
214 $this->tpl->setVariable(
'PERM_DISABLED',
'disabled="disabled"');
217 $this->tpl->parseCurrentBlock();
219 $this->tpl->setCurrentBlock(
'perm_desc_td');
221 $this->tpl->setVariable(
'DESC_PERM_ID',
$row[
'ops_id']);
223 if (
$row[
"create_type"] !=
"" && $objDefinition->isPlugin(
$row[
'create_type'])) {
224 $this->tpl->setVariable(
231 } elseif (
$row[
"create_type"] ==
"" && $objDefinition->isPlugin($this->getTemplateType())) {
232 $this->tpl->setVariable(
240 if (substr(
$row[
'name'], 0, 6) ==
'create') {
241 #$perm = $this->lng->txt($this->getTemplateType().'_'.$row['name']); 242 $perm = $this->lng->txt(
'rbac' .
'_' .
$row[
'name']);
243 } elseif ($this->lng->exists($this->getTemplateType() .
'_' .
$row[
'name'] .
'_short')) {
250 $this->tpl->setVariable(
'TXT_PERMISSION', $perm);
252 $this->tpl->parseCurrentBlock();
264 global $rbacreview, $objDefinition;
271 foreach ($rbacreview->getOperationsByTypeAndClass($this->getTemplateType(),
'object') as $ops_id) {
274 $operation = $rbacreview->getOperation($ops_id);
276 $perm[
'ops_id'] = $ops_id;
277 $perm[
'set'] = (in_array($ops_id, $operations) or $this->
getRoleId() == SYSTEM_ROLE_ID);
278 $perm[
'name'] = $operation[
'operation'];
284 $objects = $objDefinition->getCreatableSubObjects($this->
getTemplateType());
288 $ops_id = $ops_ids[
$type];
294 $perm[
'ops_id'] = $ops_id;
295 $perm[
'set'] = (in_array($ops_id, $operations) or $this->
getRoleId() == SYSTEM_ROLE_ID);
297 $perm[
'name'] =
'create_' .
$info[
'name'];
298 $perm[
'create_type'] =
$info[
'name'];
304 !$this->show_admin_permissions &&
getRoleId()
Get currrent role id.
static lookupTxtById($plugin_id, $lang_var)
getTemplateType()
get current tempalte type
__construct($a_parent_obj, $a_parent_cmd, $a_ref_id, $a_role_id, $a_type, $a_show_admin_permissions=false)
Constructor.
Table for object role permissions.
setShowChangeExistingObjects($a_status)
getShowChangeExistingObjects()
$show_change_existing_objects
setNoEntriesText($a_text)
Set text for an empty table.
parse()
Parse permissions.
fillRow($row)
Fill row template.
static lookupCreateOperationIds($a_type_arr)
Lookup operation ids.
getRefId()
Get ref id of current object.
getPermissions($a_type)
Get permissions by type.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
static _lookupObjId($a_id)
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
disable($a_module_name)
diesables particular modules of table
initTemplateType($a_type)
Set object type for current template permission table.
setFormName($a_formname="")
Set Form name.
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.
static $template_permissions
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setEnableHeader($a_enableheader)
Set Enable Header.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
initTemplatePermissions()
setLimit($a_limit=0, $a_default_limit=0)