4 include_once (
'./Services/Table/classes/class.ilTable2GUI.php');
5 include_once
'./Services/AccessControl/classes/class.ilPermissionGUI.php';
33 public function __construct($a_parent_obj,$a_parent_cmd, $a_ref_id,$a_role_id,$a_type,$a_show_admin_permissions =
false)
37 $this->tpl_type = $a_type;
38 $this->show_admin_permissions = $a_show_admin_permissions;
42 $this->
setId(
'role_template_'.$a_ref_id.
'_'.$a_type);
47 $this->lng->loadLanguageModule(
'rbac');
49 $this->ref_id = $a_ref_id;
50 $this->role_id = $a_role_id;
52 $this->role_folder_id = $rbacreview->getRoleFolderIdOfObject($this->
getRefId());
54 $this->
setRowTemplate(
"tpl.obj_role_template_perm_row.html",
"Services/AccessControl");
80 if(self::$template_permissions !== NULL)
84 self::$template_permissions = $rbacreview->getAllOperationsOfRole(
97 return self::$template_permissions[$a_type] ? self::$template_permissions[$a_type] : array();
169 global $objDefinition;
171 if(isset(
$row[
'show_ce']))
173 $this->tpl->setCurrentBlock(
'ce_td');
175 $this->tpl->parseCurrentBlock();
177 $this->tpl->setCurrentBlock(
'ce_desc_td');
179 $this->tpl->setVariable(
'CE_LONG',$this->lng->txt(
'change_existing_object_type_desc'));
181 if($objDefinition->isSystemObject($this->getTemplateType()))
183 $this->tpl->setVariable(
"TXT_CE",
184 $this->lng->txt(
"change_existing_prefix_single").
" ".
186 $this->lng->txt(
"change_existing_suffix_single")
193 "objs_".$this->getTemplateType())
194 : $this->lng->txt(
'objs_'.$this->getTemplateType());
196 $this->tpl->setVariable(
'TXT_CE',
197 $this->lng->txt(
'change_existing_prefix').
' '.
199 $this->lng->txt(
'change_existing_suffix'));
200 $this->tpl->parseCurrentBlock();
206 $this->tpl->setCurrentBlock(
'perm_td');
208 $this->tpl->setVariable(
'PERM_PERM_ID',
$row[
'ops_id']);
209 $this->tpl->setVariable(
'PERM_CHECKED',
$row[
'set'] ?
'checked="checked"' :
'');
210 $this->tpl->parseCurrentBlock();
212 $this->tpl->setCurrentBlock(
'perm_desc_td');
214 $this->tpl->setVariable(
'DESC_PERM_ID',
$row[
'ops_id']);
216 if (
$row[
"create_type"] !=
"" && $objDefinition->isPlugin(
$row[
'create_type']))
218 $this->tpl->setVariable(
'TXT_PERMISSION',
222 else if (
$row[
"create_type"] ==
"" && $objDefinition->isPlugin($this->getTemplateType()))
224 $this->tpl->setVariable(
'TXT_PERMISSION',
230 if(substr(
$row[
'name'],0,6) ==
'create')
234 elseif($this->lng->exists($this->getTemplateType().
'_'.
$row[
'name'].
'_short'))
244 $this->tpl->setVariable(
'TXT_PERMISSION',$perm);
246 $this->tpl->parseCurrentBlock();
258 global $rbacreview, $objDefinition;
265 foreach($rbacreview->getOperationsByTypeAndClass($this->getTemplateType(),
'object') as $ops_id)
269 $operation = $rbacreview->getOperation($ops_id);
271 $perm[
'ops_id'] = $ops_id;
272 $perm[
'set'] = in_array($ops_id,$operations);
273 $perm[
'name'] = $operation[
'operation'];
279 $objects = $objDefinition->getCreatableSubObjects($this->
getTemplateType());
282 foreach($objects as $type => $info)
284 $ops_id = $ops_ids[$type];
291 $perm[
'ops_id'] = $ops_id;
292 $perm[
'set'] = in_array($ops_id,$operations);
294 $perm[
'name'] =
'create_'.$info[
'name'];
295 $perm[
'create_type'] = $info[
'name'];
300 if(!$this->show_admin_permissions)
302 $rows[] = array(
'show_ce' => 1);