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';
143 if($this->
getType() == self::TYPE_VIEW)
158 case self::TYPE_VIEW:
167 case self::TYPE_SEARCH:
176 include_once
'./Services/Form/classes/class.ilSelectInputGUI.php';
177 $roles =
new ilSelectInputGUI($this->lng->txt(
'rbac_role_selection'),
'role_type');
183 $roles->readFromSession();
184 if(!$roles->getValue())
190 include_once
'./Services/Form/classes/class.ilTextInputGUI.php';
196 $title->readFromSession();
198 $this->filter[
'role_type'] = $roles->getValue();
199 $this->filter[
'role_title'] =
$title->getValue();
208 global $rbacreview,$tree;
210 if($set[
'type'] ==
'role')
212 if($set[
'parent'] != ROLE_FOLDER_ID)
214 $this->ctrl->setParameterByClass(
221 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"obj_id", $set[
"obj_id"]);
222 $link = $this->ctrl->getLinkTargetByClass(
"ilobjrolegui",
"perm");
223 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"rolf_ref_id",
"");
227 $this->ctrl->setParameterByClass(
"ilobjroletemplategui",
"obj_id", $set[
"obj_id"]);
228 $link = $this->ctrl->getLinkTargetByClass(
"ilobjroletemplategui",
"perm");
231 switch($set[
'rtype'])
233 case self::TYPE_GLOBAL_AU:
234 $this->tpl->setVariable(
'ROLE_TYPE', $this->lng->txt(
'rbac_auto_global'));
236 case self::TYPE_GLOBAL_UD:
237 $this->tpl->setVariable(
'ROLE_TYPE', $this->lng->txt(
'rbac_ud_global'));
239 case self::TYPE_LOCAL_AU:
240 $this->tpl->setVariable(
'ROLE_TYPE', $this->lng->txt(
'rbac_auto_local'));
242 case self::TYPE_LOCAL_UD:
243 $this->tpl->setVariable(
'ROLE_TYPE', $this->lng->txt(
'rbac_ud_local'));
245 case self::TYPE_ROLT_AU:
246 $this->tpl->setVariable(
'ROLE_TYPE', $this->lng->txt(
'rbac_auto_rolt'));
248 case self::TYPE_ROLT_UD:
249 $this->tpl->setVariable(
'ROLE_TYPE', $this->lng->txt(
'rbac_ud_rolt'));
256 ($set[
'obj_id'] != ANONYMOUS_ROLE_ID and
257 $set[
'obj_id'] != SYSTEM_ROLE_ID and
258 substr($set[
'title_orig'],0,3) !=
'il_') or
261 $this->tpl->setVariable(
'VAL_ID', $set[
'obj_id']);
263 $this->tpl->setVariable(
'VAL_TITLE_LINKED', $set[
'title']);
264 $this->tpl->setVariable(
'VAL_LINK', $link);
265 if(strlen($set[
'description']))
267 $this->tpl->setVariable(
'VAL_DESC', $set[
'description']);
277 $ref = $set[
'parent'];
278 if($ref == ROLE_FOLDER_ID)
280 $this->tpl->setVariable(
'CONTEXT', $this->lng->txt(
'rbac_context_global'));
284 $this->tpl->setVariable(
286 (
string) $this->
getPathGUI()->getPath(ROOT_FOLDER_ID,$ref)
290 if($this->
getType() == self::TYPE_VIEW and $set[
'obj_id'] != SYSTEM_ROLE_ID)
293 $this->tpl->setVariable(
'COPY_TEXT',$this->lng->txt(
'rbac_role_rights_copy'));
294 $this->ctrl->setParameter($this->
getParentObject(),
"copy_source", $set[
"obj_id"]);
295 $link = $this->ctrl->getLinkTarget($this->
getParentObject(),
'roleSearch');
296 $this->tpl->setVariable(
308 public function parse($role_folder_id)
312 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
314 if($this->
getType() == self::TYPE_VIEW)
333 $role_list = $rbacreview->getRolesByFilter(
341 foreach((array) $role_list as $role)
343 if($role[
'parent'] and
$GLOBALS[
'tree']->isDeleted($role[
'parent']))
351 if(strlen($filter_orig))
353 if(stristr(
$title, $filter_orig) == FALSE)
361 $rows[$counter][
'title_orig'] = $role[
'title'];
362 $rows[$counter][
'title'] =
$title;
363 $rows[$counter][
'description'] = $role[
'description'];
364 $rows[$counter][
'obj_id'] = $role[
'obj_id'];
365 $rows[$counter][
'parent'] = $role[
'parent'];
366 $rows[$counter][
'type'] = $role[
'type'];
368 $auto = (substr($role[
'title'], 0, 3) ==
'il_' ?
true :
false);
372 if($role[
'type'] ==
'rolt')
379 if($role[
'parent'] == ROLE_FOLDER_ID)
381 if($role[
'obj_id'] == ANONYMOUS_ROLE_ID or $role[
'obj_id'] == SYSTEM_ROLE_ID)