ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 $DIC;
21 
22  $lng = $DIC['lng'];
23  $ilCtrl = $DIC['ilCtrl'];
24 
25  $this->lng = $lng;
26  $this->ctrl = $ilCtrl;
27  $this->server_id = $a_server_id;
28 
29  parent::__construct($a_parent_obj, $a_parent_cmd);
30  $this->addColumn("");
31  $this->addColumn($this->lng->txt('title'), "role");
32  $this->addColumn($this->lng->txt('obj_role'), "role");
33  $this->addColumn($this->lng->txt('ldap_group_dn'), "dn");
34  $this->addColumn($this->lng->txt('ldap_server'), "url");
35  $this->addColumn($this->lng->txt('ldap_group_member'), "member_attribute");
36  $this->addColumn($this->lng->txt('ldap_info_text'), "info");
37  $this->addColumn($this->lng->txt('action'));
38 
39  $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
40  $this->setRowTemplate("tpl.ldap_role_mapping_row.html", "Services/LDAP");
41  $this->setDefaultOrderField('title');
42  $this->setDefaultOrderDirection("desc");
43  $this->addMultiCommand('confirmDeleteRoleMapping', $this->lng->txt("delete"));
44 
45  $this->getItems();
46  }
47 
54  public function fillRow($a_set)
55  {
56  global $DIC;
57 
58  $ilObjDataCache = $DIC['ilObjDataCache'];
59  $rbacreview = $DIC['rbacreview'];
60  $title = $ilObjDataCache->lookupTitle($rbacreview->getObjectOfRole($a_set["role"]));
61  $this->tpl->setVariable("VAL_ID", $a_set['mapping_id']);
62  $this->tpl->setVariable("VAL_TITLE", ilUtil::shortenText($title, 30, true));
63  $this->tpl->setVariable("VAL_ROLE", $a_set["role_name"]);
64  $this->tpl->setVariable("VAL_GROUP", $a_set["dn"]);
65  $this->tpl->setVariable("VAL_URL", $a_set["url"]);
66  $this->tpl->setVariable("VAL_MEMBER", $a_set["member_attribute"]);
67  $this->tpl->setVariable("VAL_INFO", ilUtil::prepareFormOutput($a_set['info']));
68  $this->ctrl->setParameter($this->getParentObject(), 'mapping_id', $a_set['mapping_id']);
69  $this->tpl->setVariable("EDIT_URL", $this->ctrl->getLinkTarget($this->getParentObject(), 'addRoleMapping'));
70  $this->tpl->setVariable("EDIT_TXT", $this->lng->txt('copy'));
71  $this->ctrl->setParameter($this->getParentObject(), 'mapping_id', $a_set['mapping_id']);
72  $this->tpl->setVariable("COPY_URL", $this->ctrl->getLinkTarget($this->getParentObject(), 'editRoleMapping'));
73  $this->tpl->setVariable("COPY_TXT", $this->lng->txt('edit'));
74  }
75 
79  public function getItems()
80  {
81  include_once('Services/LDAP/classes/class.ilLDAPRoleGroupMappingSettings.php');
82  $mapping_instance = ilLDAPRoleGroupMappingSettings::_getInstanceByServerId($this->server_id);
83  $this->setData($mapping_instance->getMappings());
84  }
85 }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
static shortenText( $a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
global $DIC
Definition: saml.php:7
__construct($a_parent_obj, $a_server_id, $a_parent_cmd='')
getParentObject()
Get parent object.
global $ilCtrl
Definition: ilias.php:18
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
Class ilTable2GUI.
static _getInstanceByServerId($a_server_id)
Get instance of class.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
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.
fillRow($a_set)
fill row type $ilObjDataCache ilRbacReview $rbacreview