ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
5include_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?>
static _getInstanceByServerId($a_server_id)
Get instance of class.
__construct($a_parent_obj, $a_server_id, $a_parent_cmd='')
Constructor.
fillRow($a_set)
fill row @global type $ilObjDataCache @global ilRbacReview $rbacreview
Class ilTable2GUI.
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.
getParentObject()
Get parent object.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
static shortenText($a_str, $a_len, $a_dots=false, $a_next_blank=false, $a_keep_extension=false)
shorten a string to given length.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40