ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilLDAPServerTableGUI.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
15{
16 public function __construct($a_parent_obj, $a_parent_cmd = "", $a_template_context = "")
17 {
18 parent::__construct($a_parent_obj, $a_parent_cmd, $a_template_context);
19
20 $this->setId('ldap_server_list');
21
22 $this->setTitle($this->lng->txt('ldap_servers'));
23 $this->setRowTemplate('tpl.ldap_server_row.html', 'Services/LDAP');
24
25 $this->addColumn($this->lng->txt('active'), '', '1%');
26 $this->addColumn($this->lng->txt('title'), '', '80%');
27 $this->addColumn($this->lng->txt('user'), "", "4%");
28 $this->addColumn($this->lng->txt('actions'), '', '15%');
29
30 $this->importData();
31 }
32
33 private function importData()
34 {
35 include_once './Services/LDAP/classes/class.ilLDAPServer.php';
36
38 $this->setData($data);
39 }
40
41 protected function fillRow($a_set)
42 {
43 global $DIC;
44
45 $ilCtrl = $DIC['ilCtrl'];
46 if ($a_set['active']) {
47 $this->tpl->setVariable('IMAGE_OK', ilUtil::getImagePath('icon_ok.svg'));
48 $this->tpl->setVariable('TXT_OK', $this->lng->txt('active'));
49 } else {
50 $this->tpl->setVariable('IMAGE_OK', ilUtil::getImagePath('icon_not_ok.svg'));
51 $this->tpl->setVariable('TXT_OK', $this->lng->txt('inactive'));
52 }
53
54 $this->tpl->setVariable('VAL_TITLE', $a_set["name"]);
55
56 //user
57 $user = count(ilObjUser::_getExternalAccountsByAuthMode("ldap_" . $a_set["server_id"]));
58 $this->tpl->setVariable('VAL_USER', $user);
59
60 $ilCtrl->setParameter($this->getParentObject(), 'ldap_server_id', $a_set['server_id']);
61 $this->tpl->setVariable('EDIT_LINK', $ilCtrl->getLinkTarget($this->getParentObject(), 'editServerSettings'));
62
63 //actions
64 global $DIC;
65 if ($DIC->rbac()->system()->checkAccess("write", $_GET['ref_id'])) {
66 include_once './Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
67 $list = new ilAdvancedSelectionListGUI();
68 $list->setSelectionHeaderClass('small');
69 $list->setItemLinkClass('small');
70 $list->setId('actl_' . $a_set['server_id']);
71 $list->setListTitle($this->lng->txt('actions'));
72 $list->addItem($this->lng->txt('edit'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'editServerSettings'));
73
74 if ($a_set['active']) {
75 $list->addItem(
76 $this->lng->txt('deactivate'),
77 '',
78 $ilCtrl->getLinkTarget($this->getParentObject(), 'deactivateServer')
79 );
80 } else {
81 $list->addItem(
82 $this->lng->txt('activate'),
83 '',
84 $ilCtrl->getLinkTarget($this->getParentObject(), 'activateServer')
85 );
86 }
87
88 $list->addItem(
89 $this->lng->txt('delete'),
90 '',
91 $ilCtrl->getLinkTarget($this->getParentObject(), 'confirmDeleteServerSettings')
92 );
93
94 $this->tpl->setVariable('ACTIONS', $list->getHTML());
95 }
96 }
97}
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
User interface class for advanced drop-down selection lists.
__construct($a_parent_obj, $a_parent_cmd="", $a_template_context="")
ilTable2GUI constructor.
fillRow($a_set)
Standard Version of Fill Row.
static _getAllServer()
Get list of all configured servers.
static _getExternalAccountsByAuthMode($a_auth_mode, $a_read_auth_default=false)
Get list of external account by authentication method Note: If login == ext_account for two user with...
Class ilTable2GUI.
getParentObject()
Get parent object.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
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.
setId($a_val)
Set id.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $ilCtrl
Definition: ilias.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46