ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilMemcacheServerTableGUI.php
Go to the documentation of this file.
1 <?php
2 require_once('class.ilMemcacheServer.php');
3 require_once('./Services/Table/classes/class.ilTable2GUI.php');
4 require_once('./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php');
5 require_once('./Services/Form/classes/class.ilMultiSelectInputGUI.php');
6 
14 {
15  const TPL_ID = 'tbl_il_memcached _servers';
19  protected $filter = array();
20 
21 
22  public function __construct()
23  {
24  global $DIC;
25  $lng = $DIC['lng'];
26  parent::__construct(null, '');
27  $this->setTitle($lng->txt('memcache_servers'));
28  $this->setLimit(9999);
29  $this->initColumns();
30 
31  $this->setDefaultOrderField('status');
32  $this->setDefaultOrderDirection('asc');
33 
34  $this->setEnableHeader(true);
35  $this->setFormAction('setup.php?cmd=gateway');
36  $this->setRowTemplate('tpl.memcache_servers.html', 'Services/GlobalCache');
37  $this->disable('footer');
38  $this->setEnableTitle(true);
39 
40  $this->parseData();
41  }
42 
43 
47  public function fillRow($a_set)
48  {
52  $server = ilMemcacheServer::find($a_set['id']);
53 
54  $this->tpl->setVariable('STATUS', $server->isActive() ? ilUtil::getImagePath('icon_ok.svg') : ilUtil::getImagePath('icon_not_ok.svg'));
55  $this->tpl->setVariable('STATUS_SERVER', $server->isReachable() ? ilUtil::getImagePath('icon_ok.svg') : ilUtil::getImagePath('icon_not_ok.svg'));
56  $this->tpl->setVariable('HOST', $server->getHost());
57  $this->tpl->setVariable('PORT', $server->getPort());
58  $this->tpl->setVariable('WEIGHT', $server->getWeight());
59  $this->addActionMenu($server);
60  }
61 
62 
67  {
68  $current_selection_list = new ilAdvancedSelectionListGUI();
69  $current_selection_list->setListTitle($this->lng->txt('memcache_actions'));
70  $current_selection_list->setId('request_overview_actions_' . $server->getId());
71  $current_selection_list->setUseImages(false);
72 
73  $current_selection_list->addItem($this->lng->txt('memcache_edit'), 'memcache_edit', 'setup.php?cmd=editMemcacheServer&mcsid='
74  . $server->getId());
75  $current_selection_list->addItem($this->lng->txt('memcache_delete'), 'memcache_delete', 'setup.php?cmd=deleteMemcacheServer&mcsid='
76  . $server->getId());
77  $this->tpl->setVariable('ACTIONS', $current_selection_list->getHTML());
78  }
79 
80 
81  protected function parseData()
82  {
83  $servers = ilMemcacheServer::getArray();
84  $this->setData($servers);
85  }
86 
87 
88  protected function initColumns()
89  {
90  $this->addColumn($this->txt('status'), '', '25px');
91  $this->addColumn($this->txt('status_server'), '', '25px');
92  $this->addColumn($this->txt('host'), '');
93  $this->addColumn($this->txt('port'), '');
94  $this->addColumn($this->txt('weight'), '');
95  $this->addColumn($this->txt('actions'), '', '10px');
96  }
97 
98 
104  protected function txt($key)
105  {
106  return $this->lng->txt('memcache_' . $key);
107  }
108 }
Class ilMemcacheServerTableGUI.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
global $DIC
Definition: saml.php:7
$server
Definition: sabredav.php:48
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
Class ilTable2GUI.
addActionMenu(ilMemcacheServer $server)
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.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
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.
setEnableHeader($a_enableheader)
Set Enable Header.
static getArray($key=null, $values=null)
fillRow($a_set)
Standard Version of Fill Row.
Class ilMemcacheServer.
setEnableTitle($a_enabletitle)
Set Enable Title.
$key
Definition: croninfo.php:18
setLimit($a_limit=0, $a_default_limit=0)