ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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  function __construct($a_parent_obj, $a_parent_cmd)
21  {
22  global $ilCtrl, $lng, $ilAccess, $lng;
23 
24  parent::__construct($a_parent_obj, $a_parent_cmd);
25  $this->setTitle($lng->txt("role_assignment"));
26  $this->setId("usrroleass");
27  $this->setDefaultOrderField("title");
28  $this->setDefaultOrderDirection("asc");
29  $this->setDisableFilterHiding(true);
30  $this->addColumn("", "", "1", true);
31  $this->addColumn($this->lng->txt("role"), "title");
32  $this->addColumn($this->lng->txt("description"), "description");
33  $this->addColumn($this->lng->txt("context"), "path");
34  $this->setSelectAllCheckbox("role_id[]");
35  $this->initFilter();
36  $this->setEnableHeader(true);
37  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
38  $this->setRowTemplate("tpl.role_assignment_row.html", "Services/User");
39  $this->setEnableTitle(true);
40 
41  $this->addMultiCommand("assignSave", $lng->txt("change_assignment"));
42  }
43 
47  function initFilter()
48  {
49  global $lng;
50 
51  // roles
52  $option[0] = $lng->txt('assigned_roles');
53  $option[1] = $lng->txt('all_roles');
54  $option[2] = $lng->txt('all_global_roles');
55  $option[3] = $lng->txt('all_local_roles');
56  $option[4] = $lng->txt('internal_local_roles_only');
57  $option[5] = $lng->txt('non_internal_local_roles_only');
58 
59  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
60  $si = new ilSelectInputGUI($lng->txt("roles"), "role_filter");
61  $si->setOptions($option);
62  $this->addFilterItem($si);
63  $si->readFromSession();
64  $this->filter["role_filter"] = $si->getValue();
65  }
66 
70  protected function fillRow($a_set)
71  {
72  global $lng;
73 
74  $this->tpl->setVariable("CHECKBOX", $a_set["checkbox"]);
75  $this->tpl->setVariable("ROLE", $a_set["role"]);
76  $this->tpl->setVariable("DESCRIPTION", $a_set["description"]);
77  $this->tpl->setVariable("CONTEXT", $a_set["context"]);
78  }
79 
80 }
81 ?>