ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilMemcacheServerTableGUI.php
Go to the documentation of this file.
1<?php
2require_once('class.ilMemcacheServer.php');
3require_once('./Services/Table/classes/class.ilTable2GUI.php');
4require_once('./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php');
5require_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 global $DIC;
24 $lng = $DIC['lng'];
25 parent::__construct(null, '');
26 $this->setTitle($lng->txt('memcache_servers'));
27 $this->setLimit(9999);
28 $this->initColumns();
29
30 $this->setDefaultOrderField('status');
31 $this->setDefaultOrderDirection('asc');
32
33 $this->setEnableHeader(true);
34 $this->setFormAction('setup.php?cmd=gateway');
35 $this->setRowTemplate('tpl.memcache_servers.html', 'Services/GlobalCache');
36 $this->disable('footer');
37 $this->setEnableTitle(true);
38
39 $this->parseData();
40 }
41
42
46 public function fillRow($a_set) {
50 $server = ilMemcacheServer::find($a_set['id']);
51
52 $this->tpl->setVariable('STATUS', $server->isActive() ? ilUtil::getImagePath('icon_ok.svg') : ilUtil::getImagePath('icon_not_ok.svg'));
53 $this->tpl->setVariable('STATUS_SERVER', $server->isReachable() ? ilUtil::getImagePath('icon_ok.svg') : ilUtil::getImagePath('icon_not_ok.svg'));
54 $this->tpl->setVariable('HOST', $server->getHost());
55 $this->tpl->setVariable('PORT', $server->getPort());
56 $this->tpl->setVariable('WEIGHT', $server->getWeight());
57 $this->addActionMenu($server);
58 }
59
60
65 $current_selection_list = new ilAdvancedSelectionListGUI();
66 $current_selection_list->setListTitle($this->lng->txt('memcache_actions'));
67 $current_selection_list->setId('request_overview_actions_' . $server->getId());
68 $current_selection_list->setUseImages(false);
69
70 $current_selection_list->addItem($this->lng->txt('memcache_edit'), 'memcache_edit', 'setup.php?cmd=editMemcacheServer&mcsid='
71 . $server->getId());
72 $current_selection_list->addItem($this->lng->txt('memcache_delete'), 'memcache_delete', 'setup.php?cmd=deleteMemcacheServer&mcsid='
73 . $server->getId());
74 $this->tpl->setVariable('ACTIONS', $current_selection_list->getHTML());
75 }
76
77
78 protected function parseData() {
79 $servers = ilMemcacheServer::getArray();
80 $this->setData($servers);
81 }
82
83
84 protected function initColumns() {
85 $this->addColumn($this->txt('status'), '', '25px');
86 $this->addColumn($this->txt('status_server'), '', '25px');
87 $this->addColumn($this->txt('host'), '');
88 $this->addColumn($this->txt('port'), '');
89 $this->addColumn($this->txt('weight'), '');
90 $this->addColumn($this->txt('actions'), '', '10px');
91 }
92
93
99 protected function txt($key) {
100 return $this->lng->txt('memcache_' . $key);
101 }
102}
static getArray($key=null, $values=null)
An exception for terminatinating execution or to throw for unit testing.
User interface class for advanced drop-down selection lists.
Class ilMemcacheServerTableGUI.
addActionMenu(ilMemcacheServer $server)
Class ilMemcacheServer.
Class ilTable2GUI.
setEnableHeader($a_enableheader)
Set Enable Header.
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.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
fillRow($a_set)
Standard Version of Fill Row.
setData($a_data)
set table data @access public
setEnableTitle($a_enabletitle)
Set Enable Title.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setLimit($a_limit=0, $a_default_limit=0)
set max.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
disable($a_module_name)
diesables particular modules of table
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$server
global $lng
Definition: privfeed.php:17
global $DIC