summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/classes/ctableinfo.inc.php
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-05-03 06:35:28 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2006-05-03 06:35:28 +0000
commitcff3cc1ef8b6ac526e7968be6a10c09669461be1 (patch)
treecdb8c67a959922a86e98a01b6104f52c3828b786 /frontends/php/include/classes/ctableinfo.inc.php
parent50cb63535597c91584f08f6d6f00cfcdbe0dd198 (diff)
downloadzabbix-cff3cc1ef8b6ac526e7968be6a10c09669461be1.tar.gz
zabbix-cff3cc1ef8b6ac526e7968be6a10c09669461be1.tar.xz
zabbix-cff3cc1ef8b6ac526e7968be6a10c09669461be1.zip
- improved 'Latest data' sreen, items grouped by applications (Eugene)
- added applications for hosts (Eugene) git-svn-id: svn://svn.zabbix.com/trunk@2794 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include/classes/ctableinfo.inc.php')
-rw-r--r--frontends/php/include/classes/ctableinfo.inc.php43
1 files changed, 43 insertions, 0 deletions
diff --git a/frontends/php/include/classes/ctableinfo.inc.php b/frontends/php/include/classes/ctableinfo.inc.php
index 5819ddc9..cbf43365 100644
--- a/frontends/php/include/classes/ctableinfo.inc.php
+++ b/frontends/php/include/classes/ctableinfo.inc.php
@@ -22,6 +22,8 @@
class CTableInfo extends CTable
{
/* public */
+ var $sortby;
+
function CTableInfo($message='...',$class='tableinfo')
{
parent::CTable($message,$class);
@@ -30,6 +32,7 @@
$this->SetCellSpacing(1);
$this->SetCellPadding(3);
$this->SetHeader();
+ $this->SortBy();
}
function SetHeader($value=NULL,$class='header')
{
@@ -39,5 +42,45 @@
{
parent::SetFooter($value,$class);
}
+ function SortBy($value = NULL)
+ {
+ if(!is_numeric($value) && !is_null($value))
+ {
+ return $this->error("Incorrect value for SortBy [$value]");
+ }
+ $this->sortby = $value;
+ }
+ function ShowHeader()
+ {
+ if(isset($this->header))
+ {
+ // create a copy of real header
+ $header = $this->header;
+
+ if(!is_null($this->sortby))
+ {
+ $i = 1;
+ foreach($header->items as $id => $col)
+ {
+ $sort = new CSpan();
+ $down = "_off";
+ $up = "_off";
+
+ if(($i-$this->sortby) == 0) $down = "";
+ if(($i+$this->sortby) == 0) $up = "";
+
+ $sort->AddItem(array(
+ new CImg("images/general/sortup$up.gif"),
+ new CImg("images/general/sortdown$down.gif"),
+ SPACE));
+ $sort->AddOption("style","float:left");
+
+ $header->items[$id]->AddItem($sort);
+ $i++;
+ }
+ }
+ $header->Show();
+ }
+ }
}
?>