4 include_once
'./Services/Table/classes/class.ilTable2GUI.php';
43 $this->
setId(
'rolf_role_tbl');
46 $this->lng->loadLanguageModule(
'rbac');
47 $this->lng->loadLanguageModule(
'search');
56 $this->type = $a_type;
65 $this->role_title_filter = $a_filter;
105 case self::TYPE_VIEW:
110 $this->
addColumn($this->lng->txt(
'search_title_description'),
'title',
'30%');
111 $this->
addColumn($this->lng->txt(
'type'),
'rtype',
'20%');
112 $this->
addColumn($this->lng->txt(
'context'),
'',
'40%');
113 $this->
addColumn($this->lng->txt(
'actions'),
'',
'10%');
114 $this->
setTitle($this->lng->txt(
'objs_role'));
118 case self::TYPE_SEARCH:
122 $this->
addColumn($this->lng->txt(
'search_title_description'),
'title',
'30%');
123 $this->
addColumn($this->lng->txt(
'type'),
'rtype',
'20%');
124 $this->
addColumn($this->lng->txt(
'context'),
'',
'50%');
125 $this->
setTitle($this->lng->txt(
'rbac_role_rights_copy'));
126 $this->
addMultiCommand(
'chooseCopyBehaviour',$this->lng->txt(
'btn_next'));
132 $this->
setRowTemplate(
'tpl.role_row.html',
'Services/AccessControl');
133 $this->
setFormAction($this->ctrl->getFormAction($this->getParentObject()));
136 include_once
'./Services/Tree/classes/class.ilPathGUI.php';
144 if($this->
getType() == self::TYPE_VIEW)
159 case self::TYPE_VIEW:
168 case self::TYPE_SEARCH:
177 include_once
'./Services/Form/classes/class.ilSelectInputGUI.php';
178 $roles =
new ilSelectInputGUI($this->lng->txt(
'rbac_role_selection'),
'role_type');
184 $roles->readFromSession();
185 if(!$roles->getValue())
191 include_once
'./Services/Form/classes/class.ilTextInputGUI.php';
197 $title->readFromSession();
199 $this->filter[
'role_type'] = $roles->getValue();
200 $this->filter[
'role_title'] =
$title->getValue();
209 global $rbacreview,$tree;
211 if($set[
'type'] ==
'role')
213 if($set[
'parent'] != ROLE_FOLDER_ID)
215 $this->ctrl->setParameterByClass(
222 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"obj_id", $set[
"obj_id"]);
223 $link = $this->ctrl->getLinkTargetByClass(
"ilobjrolegui",
"perm");
224 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"rolf_ref_id",
"");
228 $this->ctrl->setParameterByClass(
"ilobjroletemplategui",
"obj_id", $set[
"obj_id"]);
229 $link = $this->ctrl->getLinkTargetByClass(
"ilobjroletemplategui",
"perm");
232 switch($set[
'rtype'])
234 case self::TYPE_GLOBAL_AU:
235 $this->tpl->setVariable(
'ROLE_TYPE', $this->lng->txt(
'rbac_auto_global'));
237 case self::TYPE_GLOBAL_UD:
238 $this->tpl->setVariable(
'ROLE_TYPE', $this->lng->txt(
'rbac_ud_global'));
240 case self::TYPE_LOCAL_AU:
241 $this->tpl->setVariable(
'ROLE_TYPE', $this->lng->txt(
'rbac_auto_local'));
243 case self::TYPE_LOCAL_UD:
244 $this->tpl->setVariable(
'ROLE_TYPE', $this->lng->txt(
'rbac_ud_local'));
246 case self::TYPE_ROLT_AU:
247 $this->tpl->setVariable(
'ROLE_TYPE', $this->lng->txt(
'rbac_auto_rolt'));
249 case self::TYPE_ROLT_UD:
250 $this->tpl->setVariable(
'ROLE_TYPE', $this->lng->txt(
'rbac_ud_rolt'));
257 ($set[
'obj_id'] != ANONYMOUS_ROLE_ID and
258 $set[
'obj_id'] != SYSTEM_ROLE_ID and
259 substr($set[
'title_orig'],0,3) !=
'il_') or
262 $this->tpl->setVariable(
'VAL_ID', $set[
'obj_id']);
264 $this->tpl->setVariable(
'VAL_TITLE_LINKED', $set[
'title']);
265 $this->tpl->setVariable(
'VAL_LINK', $link);
266 if(strlen($set[
'description']))
268 $this->tpl->setVariable(
'VAL_DESC', $set[
'description']);
278 $ref = $set[
'parent'];
279 if($ref == ROLE_FOLDER_ID)
281 $this->tpl->setVariable(
'CONTEXT', $this->lng->txt(
'rbac_context_global'));
285 $this->tpl->setVariable(
287 (
string) $this->
getPathGUI()->getPath(ROOT_FOLDER_ID,$ref)
291 if($this->
getType() == self::TYPE_VIEW and $set[
'obj_id'] != SYSTEM_ROLE_ID)
294 $this->tpl->setVariable(
'COPY_TEXT',$this->lng->txt(
'rbac_role_rights_copy'));
295 $this->ctrl->setParameter($this->
getParentObject(),
"copy_source", $set[
"obj_id"]);
296 $link = $this->ctrl->getLinkTarget($this->
getParentObject(),
'roleSearch');
297 $this->tpl->setVariable(
309 public function parse($role_folder_id)
313 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
315 if($this->
getType() == self::TYPE_VIEW)
334 $role_list = $rbacreview->getRolesByFilter(
342 foreach((array) $role_list as $role)
347 $GLOBALS[
'tree']->isDeleted($role[
'parent']) or
348 !
$GLOBALS[
'tree']->isInTree($role[
'parent'])
358 if(strlen($filter_orig))
360 if(stristr(
$title, $filter_orig) == FALSE)
368 $rows[$counter][
'title_orig'] = $role[
'title'];
369 $rows[$counter][
'title'] =
$title;
370 $rows[$counter][
'description'] = $role[
'description'];
371 $rows[$counter][
'obj_id'] = $role[
'obj_id'];
372 $rows[$counter][
'parent'] = $role[
'parent'];
373 $rows[$counter][
'type'] = $role[
'type'];
375 $auto = (substr($role[
'title'], 0, 3) ==
'il_' ?
true :
false);
379 if($role[
'type'] ==
'rolt')
386 if($role[
'parent'] == ROLE_FOLDER_ID)
388 if($role[
'obj_id'] == ANONYMOUS_ROLE_ID or $role[
'obj_id'] == SYSTEM_ROLE_ID)