ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilLDAPRoleMappingTableGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once('Services/Table/classes/class.ilTable2GUI.php');
6 
17 {
18  public function __construct($a_parent_obj,$a_server_id ,$a_parent_cmd = '')
19  {
20  global $lng,$ilCtrl;
21 
22  $this->lng = $lng;
23  $this->ctrl = $ilCtrl;
24  $this->server_id = $a_server_id;
25 
26  parent::__construct($a_parent_obj,$a_parent_cmd);
27  $this->addColumn("");
28  $this->addColumn($this->lng->txt('title'), "role");
29  $this->addColumn($this->lng->txt('obj_role'), "role");
30  $this->addColumn($this->lng->txt('ldap_group_dn'), "dn");
31  $this->addColumn($this->lng->txt('ldap_server'), "url");
32  $this->addColumn($this->lng->txt('ldap_group_member'), "member_attribute");
33  $this->addColumn($this->lng->txt('ldap_info_text'), "info");
34  $this->addColumn($this->lng->txt('action'));
35 
36  $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
37  $this->setRowTemplate("tpl.ldap_role_mapping_row.html","Services/LDAP");
38  $this->setDefaultOrderField('title');
39  $this->setDefaultOrderDirection("desc");
40  $this->addMultiCommand('confirmDeleteRoleMapping', $this->lng->txt("delete"));
41 
42  $this->getItems();
43  }
44 
51  function fillRow($a_set)
52  {
53  global $ilObjDataCache, $rbacreview;
54  $title = $ilObjDataCache->lookupTitle($rbacreview->getObjectOfRole($a_set["role"]));
55  $this->tpl->setVariable("VAL_ID", $a_set['mapping_id']);
56  $this->tpl->setVariable("VAL_TITLE", ilUtil::shortenText($title,30,true));
57  $this->tpl->setVariable("VAL_ROLE", $a_set["role_name"]);
58  $this->tpl->setVariable("VAL_GROUP", $a_set["dn"]);
59  $this->tpl->setVariable("VAL_URL", $a_set["url"]);
60  $this->tpl->setVariable("VAL_MEMBER", $a_set["member_attribute"]);
61  $this->tpl->setVariable("VAL_INFO",ilUtil::prepareFormOutput($a_set['info']));
62  $this->ctrl->setParameter($this->getParentObject(),'mapping_id', $a_set['mapping_id']);
63  $this->tpl->setVariable("EDIT_URL", $this->ctrl->getLinkTarget($this->getParentObject(),'addRoleMapping'));
64  $this->tpl->setVariable("EDIT_TXT", $this->lng->txt('copy'));
65  $this->ctrl->setParameter($this->getParentObject(),'mapping_id', $a_set['mapping_id']);
66  $this->tpl->setVariable("COPY_URL", $this->ctrl->getLinkTarget($this->getParentObject(),'editRoleMapping'));
67  $this->tpl->setVariable("COPY_TXT", $this->lng->txt('edit'));
68  }
69 
73  function getItems()
74  {
75  include_once('Services/LDAP/classes/class.ilLDAPRoleGroupMappingSettings.php');
76  $mapping_instance = ilLDAPRoleGroupMappingSettings::_getInstanceByServerId($this->server_id);
77  $this->setData($mapping_instance->getMappings());
78  }
79 }
80 ?>