4 include_once
'./Services/Table/classes/class.ilTable2GUI.php';
29 private $type = self::TYPE_VIEW;
46 $this->
setId(
'rolf_role_tbl');
48 parent::__construct($a_parent_gui, $a_parent_cmd);
49 $this->lng->loadLanguageModule(
'rbac');
50 $this->lng->loadLanguageModule(
'search');
68 $this->role_title_filter = $a_filter;
107 case self::TYPE_VIEW:
112 $this->
addColumn($this->lng->txt(
'search_title_description'),
'title',
'30%');
113 $this->
addColumn($this->lng->txt(
'type'),
'rtype',
'20%');
114 $this->
addColumn($this->lng->txt(
'context'),
'',
'40%');
115 $this->
addColumn($this->lng->txt(
'actions'),
'',
'10%');
116 $this->
setTitle($this->lng->txt(
'objs_role'));
123 case self::TYPE_SEARCH:
127 $this->
addColumn($this->lng->txt(
'search_title_description'),
'title',
'30%');
128 $this->
addColumn($this->lng->txt(
'type'),
'rtype',
'20%');
129 $this->
addColumn($this->lng->txt(
'context'),
'',
'50%');
130 $this->
setTitle($this->lng->txt(
'rbac_role_rights_copy'));
131 $this->
addMultiCommand(
'chooseCopyBehaviour', $this->lng->txt(
'btn_next'));
137 $this->
setRowTemplate(
'tpl.role_row.html',
'Services/AccessControl');
138 $this->
setFormAction($this->ctrl->getFormAction($this->getParentObject()));
141 include_once
'./Services/Tree/classes/class.ilPathGUI.php';
149 if ($this->
getType() == self::TYPE_VIEW) {
162 case self::TYPE_VIEW:
171 case self::TYPE_SEARCH:
180 include_once
'./Services/Form/classes/class.ilSelectInputGUI.php';
181 $roles =
new ilSelectInputGUI($this->lng->txt(
'rbac_role_selection'),
'role_type');
187 $roles->readFromSession();
188 if (!$roles->getValue()) {
193 include_once
'./Services/Form/classes/class.ilTextInputGUI.php';
199 $title->readFromSession();
201 $this->filter[
'role_type'] = $roles->getValue();
202 $this->filter[
'role_title'] =
$title->getValue();
213 $rbacreview = $DIC[
'rbacreview'];
214 $tree = $DIC[
'tree'];
216 if ($set[
'type'] ==
'role') {
217 if ($set[
'parent'] != ROLE_FOLDER_ID) {
218 $this->ctrl->setParameterByClass(
225 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"obj_id", $set[
"obj_id"]);
226 $link = $this->ctrl->getLinkTargetByClass(
"ilobjrolegui",
"perm");
227 $this->ctrl->setParameterByClass(
"ilobjrolegui",
"rolf_ref_id",
"");
229 $this->ctrl->setParameterByClass(
"ilobjroletemplategui",
"obj_id", $set[
"obj_id"]);
230 $link = $this->ctrl->getLinkTargetByClass(
"ilobjroletemplategui",
"perm");
233 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 260 $this->
getType() == self::TYPE_SEARCH) {
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'])) {
266 $this->tpl->setVariable(
'VAL_DESC', $set[
'description']);
276 $ref = $set[
'parent'];
277 if ($ref == ROLE_FOLDER_ID) {
278 $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
and $set[
'obj_id'] != SYSTEM_ROLE_ID) {
287 if (
$GLOBALS[
'DIC'][
'rbacsystem']->checkAccess(
'write', $this->role_folder_id)) {
289 $this->tpl->setVariable(
'COPY_TEXT', $this->lng->txt(
'rbac_role_rights_copy'));
290 $this->ctrl->setParameter($this->
getParentObject(),
"csource", $set[
"obj_id"]);
291 $link = $this->ctrl->getLinkTarget($this->
getParentObject(),
'roleSearch');
292 $this->tpl->setVariable(
308 $rbacreview = $DIC[
'rbacreview'];
313 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
315 if ($this->
getType() == self::TYPE_VIEW) {
330 $role_list = $rbacreview->getRolesByFilter(
338 foreach ((array) $role_list as $role) {
342 $GLOBALS[
'DIC'][
'tree']->isDeleted($role[
'parent'])
or 343 !
$GLOBALS[
'DIC'][
'tree']->isInTree($role[
'parent'])
351 if (strlen($filter_orig)) {
352 if (stristr(
$title, $filter_orig) ==
false) {
359 $rows[$counter][
'title_orig'] = $role[
'title'];
361 $rows[$counter][
'description'] = $role[
'description'];
362 $rows[$counter][
'obj_id'] = $role[
'obj_id'];
363 $rows[$counter][
'parent'] = $role[
'parent'];
364 $rows[$counter][
'type'] = $role[
'type'];
366 $auto = (substr($role[
'title'], 0, 3) ==
'il_' ? true :
false);
370 if ($role[
'type'] ==
'rolt') {
371 $rows[$counter][
'rtype'] = $auto ? self::TYPE_ROLT_AU : self::TYPE_ROLT_UD;
374 if ($role[
'parent'] == ROLE_FOLDER_ID) {
375 if ($role[
'obj_id'] == ANONYMOUS_ROLE_ID
or $role[
'obj_id'] == SYSTEM_ROLE_ID) {
376 $rows[$counter][
'rtype'] = self::TYPE_GLOBAL_AU;
378 $rows[$counter][
'rtype'] = self::TYPE_GLOBAL_UD;
381 $rows[$counter][
'rtype'] = $auto ? self::TYPE_LOCAL_AU : self::TYPE_LOCAL_UD;
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
Creates a path for a start and endnode.
setType($a_type)
Set table type.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
getRoleTitleFilter()
Get role title filter.
setRoleTitleFilter($a_filter)
Set role title filter.
getFilterItemByPostVar($a_post_var)
parse($role_folder_id)
Parse role list.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
const FILTER_NOT_INTERNAL
getParentObject()
Get parent object.
TableGUI for the presentation og roles and role templates.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
__construct($a_parent_gui, $a_parent_cmd)
Constructor.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
addMultiCommand($a_cmd, $a_text)
Add Command button.
This class represents a text property in a property form.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
static _getTranslation($a_role_title)
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setMaxCount($a_max_count)
set max.
getPathGUI()
Get path gui.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.