summaryrefslogtreecommitdiffstats
path: root/frontends/php/include/classes
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
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')
-rw-r--r--frontends/php/include/classes/ctable.inc.php15
-rw-r--r--frontends/php/include/classes/ctableinfo.inc.php43
-rw-r--r--frontends/php/include/classes/ctag.inc.php17
3 files changed, 73 insertions, 2 deletions
diff --git a/frontends/php/include/classes/ctable.inc.php b/frontends/php/include/classes/ctable.inc.php
index b0d5485a..46a18fff 100644
--- a/frontends/php/include/classes/ctable.inc.php
+++ b/frontends/php/include/classes/ctable.inc.php
@@ -127,6 +127,7 @@
}else{
$this->header = new CRow($value,$class);
}
+ return true;
}
function SetFooter($value=NULL,$class=NULL)
{
@@ -208,10 +209,20 @@
}
}
/* protected */
- function ShowTagBody()
+ function ShowHeader()
{
- if(is_a($this->header,'crow'))
+ if(isset($this->header))
$this->header->Show();
+ }
+
+ function GetNumRows()
+ {
+ return $this->GetItemsCount();
+ }
+
+ function ShowTagBody()
+ {
+ $this->ShowHeader();
if(count($this->items)==0)
{
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();
+ }
+ }
}
?>
diff --git a/frontends/php/include/classes/ctag.inc.php b/frontends/php/include/classes/ctag.inc.php
index bdeb3099..4d58626f 100644
--- a/frontends/php/include/classes/ctag.inc.php
+++ b/frontends/php/include/classes/ctag.inc.php
@@ -19,6 +19,14 @@
**/
?>
<?php
+ function fnc($c)
+ {
+ $ret = '<tr>';
+ foreach($c as $cc)
+ $ret .= '<td>'.$cc.'</td>';
+ $ret .= '</tr>';
+ return $ret;
+ }
class CTag
{
/* private */
@@ -34,6 +42,15 @@
var $tag_start;
var $tag_end;
+ function fnc($c)
+ {
+ $ret = '<tr>';
+ foreach($c as $cc)
+ $ret .= '<td>'.$cc.'</td>';
+ $ret .= '</tr>';
+ return $ret;
+ }
+
/* public */
function CTag($name=NULL, $paired='no', $body=NULL)
{