From 21aaa15544dc4455c13c9ee2a0ef6a1bc903d3f3 Mon Sep 17 00:00:00 2001 From: hugetoad Date: Wed, 11 Jan 2006 15:50:43 +0000 Subject: Frontend improvements. git-svn-id: svn://svn.zabbix.com/trunk@2516 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- frontends/php/items.php | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) (limited to 'frontends/php/items.php') diff --git a/frontends/php/items.php b/frontends/php/items.php index 54dc3db2..6012efb4 100644 --- a/frontends/php/items.php +++ b/frontends/php/items.php @@ -245,10 +245,10 @@ { $table = new CTableInfo(); $table->setHeader(array(S_ID,S_KEY,S_DESCRIPTION,nbsp(S_UPDATE_INTERVAL),S_HISTORY,S_TRENDS,S_TYPE,S_STATUS,S_ERROR)); - $h="
"; - $h=$h.""; +// $h=""; +// $h=$h.""; - $table->setAfterHeader($h); +// $table->setAfterHeader($h); $result=DBselect("select h.host,i.key_,i.itemid,i.description,h.port,i.delay,i.history,i.lastvalue,i.lastclock,i.status,i.nextcheck,h.hostid,i.type,i.trends,i.error from hosts h,items i where h.hostid=i.hostid and h.hostid=".$_REQUEST["hostid"]." order by h.host,i.key_,i.description"); $col=0; @@ -299,13 +299,13 @@ switch($row["status"]) { case 0: - $status=array("value"=>"".S_ACTIVE."","class"=>"off"); + $status=new CCol(new CLink(S_ACTIVE, "items.php?itemid=".$row["itemid"]."&hostid=".$_REQUEST["hostid"]."®ister=changestatus&status=1","off"),"off"); break; case 1: - $status=array("value"=>"".S_NOT_ACTIVE."","class"=>"on"); + $status=new CCol(new CLink(S_ACTIVE, "items.php?itemid=".$row["itemid"]."&hostid=".$_REQUEST["hostid"]."®ister=changestatus&status=0","on"),"on"); break; case 3: - $status=array("value"=>S_NOT_SUPPORTED,"class"=>"unknown"); + $status=new CCol(S_NOT_SUPPORTED,"unknown"); break; default: $status=S_UNKNOWN; @@ -313,11 +313,11 @@ if($row["error"] == "") { - $error=array("value"=>" ","class"=>"off"); + $error=new CCol(" ","off"); } else { - $error=array("value"=>$row["error"],"class"=>"on"); + $error=new CCol($row["error"],"on"); } $table->AddRow(array( $input, @@ -331,14 +331,29 @@ $error )); } - $table->show(); +// $table->show(); - $h=""; - $h=$h.""; - $h=$h.""; - $h=$h."
"; + $footerButtons = array(); + array_push($footerButtons, new CButton('register','Activate selected', + "return Confirm('".S_ACTIVATE_SELECTED_ITEMS_Q."');")); + array_push($footerButtons, new CButton('register','Disable selected', + "return Confirm('".S_DISABLE_SELECTED_ITEMS_Q."');")); + array_push($footerButtons, new CButton('register','Delete selected', + "return Confirm('".S_DELETE_SELECTED_ITEMS_Q."');")); + $table->SetFooter(new CCol($footerButtons),'table_footer'); - show_table_header($h); + $form = new CForm('items.php'); + $form->AddVar('hostid',$_REQUEST["hostid"]); + $form->AddItem($table); + $form->Show(); + + +// $h=""; +// $h=$h.""; +// $h=$h.""; +// $h=$h.""; + +// show_table_header($h); } } -- cgit