4 include_once
'./Services/Table/classes/class.ilTable2GUI.php';
44 $this->lng->loadLanguageModule(
'rbac');
45 $this->lng->loadLanguageModule(
'search');
54 $this->type = $a_type;
63 $this->role_title_filter = $a_filter;
103 case self::TYPE_VIEW:
106 $this->
setId(
'rolf_role_tbl');
107 $this->
addColumn($this->lng->txt(
'search_title_description'),
'title',
'30%');
108 $this->
addColumn($this->lng->txt(
'type'),
'rtype',
'20%');
109 $this->
addColumn($this->lng->txt(
'context'),
'',
'40%');
110 $this->
addColumn($this->lng->txt(
'actions'),
'',
'10%');
111 $this->
setTitle($this->lng->txt(
'objs_role'));
115 case self::TYPE_SEARCH:
117 $this->
setId(
'rolf_role_search_tbl');
118 $this->
addColumn($this->lng->txt(
'search_title_description'),
'title',
'30%');
119 $this->
addColumn($this->lng->txt(
'type'),
'rtype',
'20%');
120 $this->
addColumn($this->lng->txt(
'context'),
'',
'50%');
121 $this->
setTitle($this->lng->txt(
'rbac_role_rights_copy'));
122 $this->
addMultiCommand(
'chooseCopyBehaviour',$this->lng->txt(
'btn_next'));
128 #$this->setShowRowsSelector(true);
129 $this->
setRowTemplate(
'tpl.role_row.html',
'Services/AccessControl');
130 $this->
setFormAction($this->ctrl->getFormAction($this->getParentObject()));
133 include_once
'./Services/Tree/classes/class.ilPathGUI.php';
140 if($this->
getType() == self::TYPE_VIEW)
155 case self::TYPE_VIEW:
164 case self::TYPE_SEARCH:
173 include_once
'./Services/Form/classes/class.ilSelectInputGUI.php';
174 $roles =
new ilSelectInputGUI($this->lng->txt(
'rbac_role_selection'),
'role_type');
180 $roles->readFromSession();
181 if(!$roles->getValue())
187 include_once
'./Services/Form/classes/class.ilTextInputGUI.php';
193 $title->readFromSession();
195 $this->filter[
'role_type'] = $roles->getValue();
196 $this->filter[
'role_title'] =
$title->getValue();
205 global $rbacreview,$tree;
207 if($set[
'type'] ==
'role')
209 if($set[
'parent'] != ROLE_FOLDER_ID)
211 $this->ctrl->setParameterByClass(
218 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"obj_id", $set[
"obj_id"]);
219 $link = $this->ctrl->getLinkTargetByClass(
"ilobjrolegui",
"perm");
220 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"rolf_ref_id",
"");
224 $this->ctrl->setParameterByClass(
"ilobjroletemplategui",
"obj_id", $set[
"obj_id"]);
225 $link = $this->ctrl->getLinkTargetByClass(
"ilobjroletemplategui",
"perm");
228 switch($set[
'rtype'])
230 case self::TYPE_GLOBAL_AU:
231 $this->tpl->setVariable(
'ROLE_TYPE', $this->lng->txt(
'rbac_auto_global'));
233 case self::TYPE_GLOBAL_UD:
234 $this->tpl->setVariable(
'ROLE_TYPE', $this->lng->txt(
'rbac_ud_global'));
236 case self::TYPE_LOCAL_AU:
237 $this->tpl->setVariable(
'ROLE_TYPE', $this->lng->txt(
'rbac_auto_local'));
239 case self::TYPE_LOCAL_UD:
240 $this->tpl->setVariable(
'ROLE_TYPE', $this->lng->txt(
'rbac_ud_local'));
242 case self::TYPE_ROLT_AU:
243 $this->tpl->setVariable(
'ROLE_TYPE', $this->lng->txt(
'rbac_auto_rolt'));
245 case self::TYPE_ROLT_UD:
246 $this->tpl->setVariable(
'ROLE_TYPE', $this->lng->txt(
'rbac_ud_rolt'));
253 $set[
'obj_id'] != ANONYMOUS_ROLE_ID and
254 $set[
'obj_id'] != SYSTEM_ROLE_ID and
255 substr($set[
'title_orig'],0,3) !=
'il_')
257 $this->tpl->setVariable(
'VAL_ID', $set[
'obj_id']);
259 $this->tpl->setVariable(
'VAL_TITLE_LINKED', $set[
'title']);
260 $this->tpl->setVariable(
'VAL_LINK', $link);
261 if(strlen($set[
'description']))
263 $this->tpl->setVariable(
'VAL_DESC', $set[
'description']);
273 $ref = $set[
'parent'];
274 if($ref == ROLE_FOLDER_ID)
276 $this->tpl->setVariable(
'CONTEXT', $this->lng->txt(
'rbac_context_global'));
280 $this->tpl->setVariable(
282 (
string) $this->
getPathGUI()->getPath(ROOT_FOLDER_ID,$ref)
286 if($this->
getType() == self::TYPE_VIEW)
289 $this->tpl->setVariable(
'COPY_TEXT',$this->lng->txt(
'rbac_role_rights_copy'));
290 $this->ctrl->setParameter($this->
getParentObject(),
"copy_source", $set[
"obj_id"]);
291 $link = $this->ctrl->getLinkTarget($this->
getParentObject(),
'roleSearch');
292 $this->tpl->setVariable(
304 public function parse($role_folder_id)
306 global $rbacreview,$ilUser;
308 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
310 if($this->
getType() == self::TYPE_VIEW)
328 $role_list = $rbacreview->getRolesByFilter(
336 foreach((array) $role_list as $role)
343 if(stristr(
$title, $filter) == FALSE)
349 $rows[$counter][
'title_orig'] = $role[
'title'];
350 $rows[$counter][
'title'] =
$title;
351 $rows[$counter][
'description'] = $role[
'description'];
352 $rows[$counter][
'obj_id'] = $role[
'obj_id'];
353 $rows[$counter][
'parent'] = $role[
'parent'];
354 $rows[$counter][
'type'] = $role[
'type'];
356 $auto = (substr($role[
'title'], 0, 3) ==
'il_' ?
true :
false);
360 if($role[
'type'] ==
'rolt')
367 if($role[
'parent'] == ROLE_FOLDER_ID)
369 if($role[
'obj_id'] == ANONYMOUS_ROLE_ID or $role[
'obj_id'] == SYSTEM_ROLE_ID)