ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 $ilCtrl;
44  if($a_set['active'])
45  {
46  $this->tpl->setVariable('IMAGE_OK', ilUtil::getImagePath('icon_ok.svg'));
47  $this->tpl->setVariable('TXT_OK', $this->lng->txt('active'));
48  }
49  else
50  {
51  $this->tpl->setVariable('IMAGE_OK', ilUtil::getImagePath('icon_not_ok.svg'));
52  $this->tpl->setVariable('TXT_OK', $this->lng->txt('inactive'));
53  }
54 
55  $this->tpl->setVariable('VAL_TITLE', $a_set["name"]);
56 
57  //user
58  $user = count(ilObjUser::_getExternalAccountsByAuthMode("ldap_". $a_set["server_id"]));
59  $this->tpl->setVariable('VAL_USER',$user);
60 
61  $ilCtrl->setParameter($this->getParentObject(),'ldap_server_id',$a_set['server_id']);
62  $this->tpl->setVariable('EDIT_LINK',$ilCtrl->getLinkTarget($this->getParentObject(),'editServerSettings'));
63 
64  //actions
65 
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  {
76  $list->addItem($this->lng->txt('deactivate'), '',
77  $ilCtrl->getLinkTarget($this->getParentObject(),'deactivateServer'));
78  }
79  else
80  {
81  $list->addItem($this->lng->txt('activate'), '',
82  $ilCtrl->getLinkTarget($this->getParentObject(),'activateServer'));
83  }
84 
85  $list->addItem($this->lng->txt('delete'), '',
86  $ilCtrl->getLinkTarget($this->getParentObject(),'confirmDeleteServerSettings'));
87 
88  $this->tpl->setVariable('ACTIONS',$list->getHTML());
89  }
90 }
91 ?>
__construct($a_parent_obj, $a_parent_cmd="", $a_template_context="")
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)
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.