ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 public function __construct($a_parent_obj, $a_parent_cmd)
21 {
22 global $DIC;
23
24 $ilCtrl = $DIC['ilCtrl'];
25 $lng = $DIC['lng'];
26 $ilAccess = $DIC['ilAccess'];
27
28 $lng->loadLanguageModule('rbac');
29 $this->setId("usrroleass");
30
31 parent::__construct($a_parent_obj, $a_parent_cmd);
32
33 $this->setTitle($lng->txt("role_assignment"));
34 $this->setDefaultOrderField("title");
35 $this->setDefaultOrderDirection("asc");
36 $this->setDisableFilterHiding(true);
37 $this->addColumn("", "", "1", true);
38 $this->addColumn($this->lng->txt("role"), "title");
39 $this->addColumn($this->lng->txt("description"), "description");
40 $this->addColumn($this->lng->txt("context"), "path");
41 $this->setSelectAllCheckbox("role_id[]");
42 $this->initFilter();
43 $this->setEnableHeader(true);
44 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
45 $this->setRowTemplate("tpl.role_assignment_row.html", "Services/User");
46 $this->setEnableTitle(true);
47
48 $this->addMultiCommand("assignSave", $lng->txt("change_assignment"));
49 }
50
54 public function initFilter()
55 {
56 global $DIC;
57
58 $lng = $DIC['lng'];
59
60 // roles
61 $option[0] = $lng->txt('assigned_roles');
62 $option[1] = $lng->txt('all_roles');
63 $option[2] = $lng->txt('all_global_roles');
64 $option[3] = $lng->txt('all_local_roles');
65 $option[4] = $lng->txt('internal_local_roles_only');
66 $option[5] = $lng->txt('non_internal_local_roles_only');
67
68 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
69 $si = new ilSelectInputGUI($lng->txt("roles"), "role_filter");
70 $si->setOptions($option);
71 $this->addFilterItem($si);
72 $si->readFromSession();
73 $this->filter["role_filter"] = $si->getValue();
74 }
75
79 protected function fillRow($a_set)
80 {
81 global $DIC;
82
83 $lng = $DIC['lng'];
84
85 if ($a_set['checkbox']) {
86 $this->tpl->setVariable("CHECKBOX", $a_set["checkbox"]);
87 }
88 $this->tpl->setVariable("ROLE", $a_set["role"]);
89 $this->tpl->setVariable("DESCRIPTION", $a_set["description"]);
90 $this->tpl->setVariable("CONTEXT", $a_set["context"]);
91 }
92}
An exception for terminatinating execution or to throw for unit testing.
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.
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.
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.
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.
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 $DIC
Definition: saml.php:7