ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilRoleAssignmentTableGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/Table/classes/class.ilTable2GUI.php");
5
15{
16
20 function __construct($a_parent_obj, $a_parent_cmd)
21 {
22 global $ilCtrl, $lng, $ilAccess;
23
24 $lng->loadLanguageModule('rbac');
25
26 parent::__construct($a_parent_obj, $a_parent_cmd);
27
28 $this->setTitle($lng->txt("role_assignment"));
29 $this->setId("usrroleass");
30 $this->setDefaultOrderField("title");
31 $this->setDefaultOrderDirection("asc");
32 $this->setDisableFilterHiding(true);
33 $this->addColumn("", "", "1", true);
34 $this->addColumn($this->lng->txt("role"), "title");
35 $this->addColumn($this->lng->txt("description"), "description");
36 $this->addColumn($this->lng->txt("context"), "path");
37 $this->setSelectAllCheckbox("role_id[]");
38 $this->initFilter();
39 $this->setEnableHeader(true);
40 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
41 $this->setRowTemplate("tpl.role_assignment_row.html", "Services/User");
42 $this->setEnableTitle(true);
43
44 $this->addMultiCommand("assignSave", $lng->txt("change_assignment"));
45 }
46
50 function initFilter()
51 {
52 global $lng;
53
54 // roles
55 $option[0] = $lng->txt('assigned_roles');
56 $option[1] = $lng->txt('all_roles');
57 $option[2] = $lng->txt('all_global_roles');
58 $option[3] = $lng->txt('all_local_roles');
59 $option[4] = $lng->txt('internal_local_roles_only');
60 $option[5] = $lng->txt('non_internal_local_roles_only');
61
62 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
63 $si = new ilSelectInputGUI($lng->txt("roles"), "role_filter");
64 $si->setOptions($option);
65 $this->addFilterItem($si);
66 $si->readFromSession();
67 $this->filter["role_filter"] = $si->getValue();
68 }
69
73 protected function fillRow($a_set)
74 {
75 global $lng;
76
77 if($a_set['checkbox'])
78 {
79 $this->tpl->setVariable("CHECKBOX", $a_set["checkbox"]);
80 }
81 $this->tpl->setVariable("ROLE", $a_set["role"]);
82 $this->tpl->setVariable("DESCRIPTION", $a_set["description"]);
83 $this->tpl->setVariable("CONTEXT", $a_set["context"]);
84 }
85
86}
87?>
TableGUI class for role assignment in user administration.
__construct($a_parent_obj, $a_parent_cmd)
Constructor.
This class represents a selection list property in a property form.
Class ilTable2GUI.
setEnableHeader($a_enableheader)
Set Enable Header.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
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.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setEnableTitle($a_enabletitle)
Set Enable Title.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40