ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
4 include_once("./Services/Table/classes/class.ilTable2GUI.php");
5 
15 {
16 
20  public function __construct($a_parent_obj, $a_parent_cmd)
21  {
22  global $ilCtrl, $lng, $ilAccess;
23 
24  $lng->loadLanguageModule('rbac');
25  $this->setId("usrroleass");
26 
27  parent::__construct($a_parent_obj, $a_parent_cmd);
28 
29  $this->setTitle($lng->txt("role_assignment"));
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  public 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  $this->tpl->setVariable("CHECKBOX", $a_set["checkbox"]);
79  }
80  $this->tpl->setVariable("ROLE", $a_set["role"]);
81  $this->tpl->setVariable("DESCRIPTION", $a_set["description"]);
82  $this->tpl->setVariable("CONTEXT", $a_set["context"]);
83  }
84 }
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
This class represents a selection list property in a property form.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
setId($a_val)
Set id.
global $ilCtrl
Definition: ilias.php:18
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
__construct($a_parent_obj, $a_parent_cmd)
Constructor.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
TableGUI class for role assignment in user administration.
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.
setEnableHeader($a_enableheader)
Set Enable Header.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
setEnableTitle($a_enabletitle)
Set Enable Title.