ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjectRoleTemplateOptionsTableGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
27{
28 private int $role_id;
29 private int $obj_ref_id;
30
31 private bool $show_admin_permissions = true;
32 private bool $show_options = true;
34
35 public function __construct(
36 object $a_parent_obj,
37 string $a_parent_cmd,
38 int $a_obj_ref_id,
39 int $a_role_id,
40 bool $a_show_admin_permissions = false
41 ) {
42 global $DIC;
43
44 $this->show_admin_permissions = $a_show_admin_permissions;
45 $this->rbacreview = $DIC->rbac()->review();
46
47 $this->setId('role_options_' . $a_obj_ref_id . '_' . $a_role_id);
48 parent::__construct($a_parent_obj, $a_parent_cmd);
49
50 $this->lng->loadLanguageModule('rbac');
51
52 $this->role_id = $a_role_id;
53 $this->obj_ref_id = $a_obj_ref_id;
54
55 $this->setRowTemplate("tpl.obj_role_template_options_row.html", "components/ILIAS/AccessControl");
56 $this->setLimit(100);
57 $this->setShowRowsSelector(false);
58 $this->setDisableFilterHiding(true);
59
60 $this->setEnableHeader(false);
61 $this->disable('sort');
62 $this->disable('numinfo');
63 $this->disable('form');
64
65 $this->addColumn('', '', '0');
66 $this->addColumn('', '', '100%');
67
68 $this->setTopCommands(false);
69 }
70
74 public function setShowOptions(bool $a_status): void
75 {
76 $this->show_options = $a_status;
77 }
78
79 public function getShowOptions(): bool
80 {
82 }
83
87 public function getObjectRefId(): int
88 {
89 return $this->obj_ref_id;
90 }
91
92 public function getRoleId(): int
93 {
94 return $this->role_id;
95 }
96
100 protected function fillRow(array $a_set): void
101 {
102 if (!$this->getShowOptions()) {
103 return;
104 }
105 if (isset($a_set['recursive']) && !$this->show_admin_permissions) {
106 $this->tpl->setCurrentBlock('recursive');
107 $this->tpl->setVariable('TXT_RECURSIVE', $this->lng->txt('change_existing_objects'));
108 $this->tpl->setVariable('DESC_RECURSIVE', $this->lng->txt('change_existing_objects_desc'));
109 } elseif (isset($a_set['protected'])) {
110 $this->tpl->setCurrentBlock('protected');
111
112 if (!$this->rbacreview->isAssignable($this->getRoleId(), $this->getObjectRefId())) {
113 $this->tpl->setVariable('DISABLED_PROTECTED', 'disabled="disabled"');
114 }
115
116 if ($this->rbacreview->isProtected($this->getObjectRefId(), $this->getRoleId())) {
117 $this->tpl->setVariable('PROTECTED_CHECKED', 'checked="checked"');
118 }
119
120 $this->tpl->setVariable('TXT_PROTECTED', $this->lng->txt('role_protect_permissions'));
121 $this->tpl->setVariable('DESC_PROTECTED', $this->lng->txt('role_protect_permissions_desc'));
122 $this->tpl->parseCurrentBlock();
123 }
124 }
125
129 public function parse(): void
130 {
131 $row = [];
132 $row[0]['recursive'] = 1;
133 $row[1]['protected'] = 1;
134 $this->setData($row);
135 }
136}
__construct(object $a_parent_obj, string $a_parent_cmd, int $a_obj_ref_id, int $a_role_id, bool $a_show_admin_permissions=false)
class ilRbacReview Contains Review functions of core Rbac.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setLimit(int $a_limit=0, int $a_default_limit=0)
set max.
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setEnableHeader(bool $a_enableheader)
setDisableFilterHiding(bool $a_val=true)
setTopCommands(bool $a_val)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
setData(array $a_data)
Set table data.
disable(string $a_module_name)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26