ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilLDAPRoleMappingTableGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
25 {
28  private int $server_id;
29 
33  public function __construct(object $a_parent_obj, int $a_server_id, string $a_parent_cmd = '')
34  {
35  $this->server_id = $a_server_id;
36  parent::__construct($a_parent_obj, $a_parent_cmd);
37 
38  global $DIC;
39 
40  $this->ilObjDataCache = $DIC['ilObjDataCache'];
41  $this->rbacreview = $DIC->rbac()->review();
42 
43  $this->addColumn("");
44  $this->addColumn($this->lng->txt('title'), "role");
45  $this->addColumn($this->lng->txt('obj_role'), "role");
46  $this->addColumn($this->lng->txt('ldap_group_dn'), "dn");
47  $this->addColumn($this->lng->txt('ldap_server'), "url");
48  $this->addColumn($this->lng->txt('ldap_group_member'), "member_attribute");
49  $this->addColumn($this->lng->txt('ldap_info_text'), "info");
50  $this->addColumn($this->lng->txt('action'));
51  $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
52  $this->setRowTemplate("tpl.ldap_role_mapping_row.html", "Services/LDAP");
53  $this->setDefaultOrderField('title');
54  $this->setDefaultOrderDirection("desc");
55  $this->addMultiCommand('confirmDeleteRoleMapping', $this->lng->txt("delete"));
56 
57  $this->getItems();
58  }
59 
63  protected function fillRow(array $a_set): void
64  {
65  $title = $this->ilObjDataCache->lookupTitle($this->rbacreview->getObjectOfRole((int) $a_set["role"]));
66  $this->tpl->setVariable("VAL_ID", $a_set['mapping_id']);
67  $this->tpl->setVariable("VAL_TITLE", ilStr::shortenTextExtended($title, 30, true));
68  $this->tpl->setVariable("VAL_ROLE", $a_set["role_name"]);
69  $this->tpl->setVariable("VAL_GROUP", $a_set["dn"]);
70  $this->tpl->setVariable("VAL_URL", $a_set["url"]);
71  $this->tpl->setVariable("VAL_MEMBER", $a_set["member_attribute"]);
72  $this->tpl->setVariable("VAL_INFO", ilLegacyFormElementsUtil::prepareFormOutput($a_set['info']));
73  $this->ctrl->setParameter($this->getParentObject(), 'mapping_id', $a_set['mapping_id']);
74  $this->tpl->setVariable("EDIT_URL", $this->ctrl->getLinkTarget($this->getParentObject(), 'addRoleMapping'));
75  $this->tpl->setVariable("EDIT_TXT", $this->lng->txt('copy'));
76  $this->ctrl->setParameter($this->getParentObject(), 'mapping_id', $a_set['mapping_id']);
77  $this->tpl->setVariable("COPY_URL", $this->ctrl->getLinkTarget($this->getParentObject(), 'editRoleMapping'));
78  $this->tpl->setVariable("COPY_TXT", $this->lng->txt('edit'));
79  }
80 
84  public function getItems(): void
85  {
86  $mapping_instance = ilLDAPRoleGroupMappingSettings::_getInstanceByServerId($this->server_id);
87  $this->setData($mapping_instance->getMappings());
88  }
89 }
setData(array $a_data)
setFormAction(string $a_form_action, bool $a_multipart=false)
static prepareFormOutput($a_str, bool $a_strip=false)
__construct(object $a_parent_obj, int $a_server_id, string $a_parent_cmd='')
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
static _getInstanceByServerId(int $a_server_id)
Get instance of class.
__construct(Container $dic, ilPlugin $plugin)
static shortenTextExtended(string $a_str, int $a_len, bool $a_dots=false, bool $a_next_blank=false, bool $a_keep_extension=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
addMultiCommand(string $a_cmd, string $a_text)