From 1bd57f97f90f26c13bb37cb6c669f444d80db01b Mon Sep 17 00:00:00 2001 From: hugetoad Date: Mon, 2 Jan 2006 11:29:33 +0000 Subject: Using new class cTable for queue.php (Alexei) git-svn-id: svn://svn.zabbix.com/trunk@2474 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/include/classes/table.inc.php | 80 ++++++++++++++++++++++++++++- 1 file changed, 78 insertions(+), 2 deletions(-) (limited to 'frontends/php/include/classes/table.inc.php') diff --git a/frontends/php/include/classes/table.inc.php b/frontends/php/include/classes/table.inc.php index 8a1385bb..7f0c8f26 100644 --- a/frontends/php/include/classes/table.inc.php +++ b/frontends/php/include/classes/table.inc.php @@ -21,10 +21,86 @@ rows=array(); + $this->header=array(); + $this->msg_empty=$msg_empty; + } + + function addRow($row) + { + $this->rows = array_merge($this->rows, array($row)); + } + +// Private + function setHeader($header) + { + $this->header = $header; + } + +// Private + function showHeader($class="tborder") + { + echo ""; + echo "\n"; + echo ""; + while(list($num,$element)=each($this->header)) + { + echo ""; + } + echo ""; + echo "\n"; + } + +// Private + function showFooter() + { + echo "
".$element."
"; + echo "\n"; + } + +// Private + function showRow($elements, $rownum) + { + if($rownum%2 == 1) { echo ""; } + else { echo ""; } + + while(list($num,$element)=each($elements)) + { + if(is_array($element)&&isset($element["hide"])&&($element["hide"]==1)) continue; + if(is_array($element)) + { + if(isset($element["class"])) + echo "".$element["value"].""; + else + echo "".$element["value"].""; + } + else + { + echo "".$element.""; + } + } + echo ""; + echo "\n"; + } - function addRow() + function show() { + $this->showHeader(); + while (list($num,$row) = each($this->rows)) + { + $this->showRow($row,$num); + } + if(count($this->rows) == 0) + { + echo "".$this->msg_empty."\n"; + } + $this->showFooter(); } } ?> -- cgit