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 $this->tpl->setVariable(
'TXT_PERMISSION',$this->lng->txt($this->getTemplateType().
'_'.
$row[
'name']));
232 $this->tpl->parseCurrentBlock();
244 global $rbacreview, $objDefinition;
251 foreach($rbacreview->getOperationsByTypeAndClass($this->getTemplateType(),
'object') as $ops_id)
255 $operation = $rbacreview->getOperation($ops_id);
257 $perm[
'ops_id'] = $ops_id;
258 $perm[
'set'] = in_array($ops_id,$operations);
259 $perm[
'name'] = $operation[
'operation'];
265 $objects = $objDefinition->getCreatableSubObjects($this->
getTemplateType());
268 foreach($objects as
$type => $info)
270 $ops_id = $ops_ids[
$type];
277 $perm[
'ops_id'] = $ops_id;
278 $perm[
'set'] = in_array($ops_id,$operations);
280 $perm[
'name'] =
'create_'.$info[
'name'];
281 $perm[
'create_type'] = $info[
'name'];
286 if(!$this->show_admin_permissions)
288 $rows[] = array(
'show_ce' => 1);