ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 
5 include_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 
65  include_once './Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php';
67  $list->setSelectionHeaderClass('small');
68  $list->setItemLinkClass('small');
69  $list->setId('actl_' . $a_set['server_id']);
70  $list->setListTitle($this->lng->txt('actions'));
71  $list->addItem($this->lng->txt('edit'), '', $ilCtrl->getLinkTarget($this->getParentObject(), 'editServerSettings'));
72 
73  if ($a_set['active']) {
74  $list->addItem(
75  $this->lng->txt('deactivate'),
76  '',
77  $ilCtrl->getLinkTarget($this->getParentObject(), 'deactivateServer')
78  );
79  } else {
80  $list->addItem(
81  $this->lng->txt('activate'),
82  '',
83  $ilCtrl->getLinkTarget($this->getParentObject(), 'activateServer')
84  );
85  }
86 
87  $list->addItem(
88  $this->lng->txt('delete'),
89  '',
90  $ilCtrl->getLinkTarget($this->getParentObject(), 'confirmDeleteServerSettings')
91  );
92 
93  $this->tpl->setVariable('ACTIONS', $list->getHTML());
94  }
95 }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
__construct($a_parent_obj, $a_parent_cmd="", $a_template_context="")
global $DIC
Definition: saml.php:7
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...
getParentObject()
Get parent object.
setId($a_val)
Set id.
global $ilCtrl
Definition: ilias.php:18
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$user
Definition: migrateto20.php:57
setRowTemplate($a_template, $a_template_dir="")
Set row template.
User interface class for advanced drop-down selection lists.
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.