From 45983ec077cc9ff68cfa6a0a93e1e3084c16abb6 Mon Sep 17 00:00:00 2001 From: Michael Clemens Date: Mon, 18 May 2009 15:34:04 +0000 Subject: [PATCH] this and that --- includes/tsmmonitor.php | 11 +++++++++-- index.php | 13 +++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/includes/tsmmonitor.php b/includes/tsmmonitor.php index aaec342..32a3d42 100644 --- a/includes/tsmmonitor.php +++ b/includes/tsmmonitor.php @@ -880,10 +880,12 @@ class TSMMonitor { */ function renderZebraTableRow ($row, $shade , $alarmcol, $color, $cellproperties) { + $isNotEmpty = FALSE; $colorsarray = $this->configarray["colorsarray"]; - $outp = $outp.""; + while(list($keycell, $valcell) = each($row)) { + if (isset($cellproperties) && $cellproperties[$keycell] != "") { $cellproperty = " ".$cellproperties[$keycell]." "; } else { @@ -900,10 +902,15 @@ class TSMMonitor { } else { $outp = $outp."".$valcell.""; } + if ($valcell != "") $isNotEmpty = TRUE; } $outp = $outp."\n"; - return $outp; + if ($isNotEmpty) { + return $outp; + } else { + return ""; + } } diff --git a/index.php b/index.php index a4b5647..c7d44fe 100644 --- a/index.php +++ b/index.php @@ -110,14 +110,11 @@ include_once "includes/page_head.php"; echo "KeyValue"; foreach ($tablearray as $row) { while(list($keycell, $valcell) = each($row)) { - if ($i == 0) { - echo ""; - $i = 1; - } else { - echo ""; - $i = 0; - } - echo "".$keycell."".$valcell.""; + $vertrow = array(); + $vertrow["key"] = $keycell; + $vertrow["value"] = $valcell; + echo $tsmmonitor->renderZebraTableRow($vertrow, $i%2, "", "", ""); + $i++; } }