diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-01-11 15:50:43 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-01-11 15:50:43 +0000 |
| commit | 21aaa15544dc4455c13c9ee2a0ef6a1bc903d3f3 (patch) | |
| tree | a4125cbe382db2b8354f5e35388a3df7a5f7a3dc /frontends/php | |
| parent | e87f5ebd4db58b76543980eb24a4efe044003e59 (diff) | |
| download | zabbix-21aaa15544dc4455c13c9ee2a0ef6a1bc903d3f3.tar.gz zabbix-21aaa15544dc4455c13c9ee2a0ef6a1bc903d3f3.tar.xz zabbix-21aaa15544dc4455c13c9ee2a0ef6a1bc903d3f3.zip | |
Frontend improvements.
git-svn-id: svn://svn.zabbix.com/trunk@2516 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
| -rw-r--r-- | frontends/php/hosts.php | 56 | ||||
| -rw-r--r-- | frontends/php/items.php | 43 |
2 files changed, 63 insertions, 36 deletions
diff --git a/frontends/php/hosts.php b/frontends/php/hosts.php index 2b5e506d..79b2942d 100644 --- a/frontends/php/hosts.php +++ b/frontends/php/hosts.php @@ -484,7 +484,7 @@ <?php $table = new CTableInfo(S_NO_HOSTS_DEFINED); $table->setHeader(array(S_ID,S_HOST,S_IP,S_PORT,S_STATUS,S_AVAILABILITY,S_ERROR,S_ACTIONS)); - $table->setAfterHeader("<form method=\"get\" action=\"hosts.php\">"); +// $table->setAfterHeader("<form method=\"get\" action=\"hosts.php\">"); if(isset($_REQUEST["groupid"])) { @@ -516,48 +516,46 @@ if(check_right("Host","U",$row["hostid"])) { if($row["status"] == HOST_STATUS_MONITORED) - $status=array("value"=>"<a class=\"off\" href=\"hosts.php?hostid=".$row["hostid"]."&register=changestatus&status=1\">".S_MONITORED."</a>","class"=>"off"); + $status=new CCol(new CLink(S_MONITORED,"hosts.php?hostid=".$row["hostid"]."&register=changestatus&status=1","off"),"off"); else if($row["status"] == HOST_STATUS_NOT_MONITORED) - $status=array("value"=>"<a class=\"on\" href=\"hosts.php?hostid=".$row["hostid"]."&register=changestatus&status=0\">".S_NOT_MONITORED."</a>","class"=>"on"); - // else if($row["status"] == 2) - // $status=array("value"=>S_UNREACHABLE,"class"=>"unknown"); + $status=new CCol(new CLink(S_NOT_MONITORED,"hosts.php?hostid=".$row["hostid"]."&register=changestatus&status=0","on"),"on"); else if($row["status"] == HOST_STATUS_TEMPLATE) - $status=array("value"=>S_TEMPLATE,"class"=>"unknown"); + $status=new CCol(S_TEMPLATE,"unknown"); else if($row["status"] == HOST_STATUS_DELETED) - $status=array("value"=>S_DELETED,"class"=>"unknown"); + $status=new CCol(S_DELETED,"unknown"); else $status=S_UNKNOWN; } else { if($row["status"] == HOST_STATUS_MONITORED) - $status=array("value"=>S_MONITORED,"class"=>"off"); + $status=new CCol(S_MONITORED,"off"); else if($row["status"] == HOST_STATUS_NOT_MONITORED) - $status=array("value"=>S_NOT_MONITORED,"class"=>"on"); + $status=new CCol(S_NOT_MONITORED,"on"); // else if($row["status"] == 2) // $status=array("value"=>S_UNREACHABLE,"class"=>"unknown"); else if($row["status"] == HOST_STATUS_TEMPLATE) - $status=array("value"=>S_TEMPLATE,"class"=>"unknown"); + $status=new CCol(S_TEMPLATE,"unknown"); else if($row["status"] == HOST_STATUS_DELETED) - $status=array("value"=>S_DELETED,"class"=>"unknown"); + $status=new CCol(S_DELETED,"unknown"); else $status=S_UNKNOWN; } if($row["available"] == HOST_AVAILABLE_TRUE) - $available=array("value"=>S_AVAILABLE,"class"=>"off"); + $available=new CCol(S_AVAILABLE,"off"); else if($row["available"] == HOST_AVAILABLE_FALSE) - $available=array("value"=>S_NOT_AVAILABLE,"class"=>"on"); + $available=new CCol(S_NOT_AVAILABLE,"on"); else if($row["available"] == HOST_AVAILABLE_UNKNOWN) - $available=array("value"=>S_UNKNOWN,"class"=>"unknown"); + $available=new CCol(S_UNKNOWN,"unknown"); 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"); } if(check_right("Host","U",$row["hostid"])) { @@ -592,14 +590,28 @@ $error, $actions)); } - $table->show(); +// $table->show(); + + $footerButtons = array(); + array_push($footerButtons, new CButton('register','Activate selected', + "return Confirm('".S_ACTIVATE_SELECTED_HOSTS_Q."');")); + array_push($footerButtons, new CButton('register','Disable selected', + "return Confirm('".S_DISABLE_SELECTED_HOSTS_Q."');")); + array_push($footerButtons, new CButton('register','Delete selected', + "return Confirm('".S_DELETE_SELECTED_HOSTS_Q."');")); + $table->SetFooter(new CCol($footerButtons),'table_footer'); + + $form = new CForm('hosts.php'); + $form->AddItem($table); + $form->Show(); + // show_form_begin(); - $h="<input class=\"button\" type=\"submit\" name=\"register\" value=\"Activate selected\" onClick=\"return Confirm('".S_ACTIVATE_SELECTED_HOSTS_Q."');\">"; - $h=$h."<input class=\"button\" type=\"submit\" name=\"register\" value=\"Disable selected\" onClick=\"return Confirm('".S_DISABLE_SELECTED_HOSTS_Q."');\">"; - $h=$h."<input class=\"button\" type=\"submit\" name=\"register\" value=\"Delete selected\" onClick=\"return Confirm('".S_DELETE_SELECTED_HOSTS_Q."');\">"; - $h=$h."</form>"; - show_table_header($h); +// $h="<input class=\"button\" type=\"submit\" name=\"register\" value=\"Activate selected\" onClick=\"return Confirm('".S_ACTIVATE_SELECTED_HOSTS_Q."');\">"; +// $h=$h."<input class=\"button\" type=\"submit\" name=\"register\" value=\"Disable selected\" onClick=\"return Confirm('".S_DISABLE_SELECTED_HOSTS_Q."');\">"; +// $h=$h."<input class=\"button\" type=\"submit\" name=\"register\" value=\"Delete selected\" onClick=\"return Confirm('".S_DELETE_SELECTED_HOSTS_Q."');\">"; +// $h=$h."</form>"; +// show_table_header($h); } else { 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="<form method=\"get\" action=\"items.php\">"; - $h=$h."<input class=\"biginput\" name=\"hostid\" type=hidden value=".$_REQUEST["hostid"]." size=8>"; +// $h="<form method=\"get\" action=\"items.php\">"; +// $h=$h."<input class=\"biginput\" name=\"hostid\" type=hidden value=".$_REQUEST["hostid"]." size=8>"; - $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"=>"<a class=\"off\" href=\"items.php?itemid=".$row["itemid"]."&hostid=".$_REQUEST["hostid"]."®ister=changestatus&status=1\">".S_ACTIVE."</a>","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"=>"<a class=\"on\" href=\"items.php?itemid=".$row["itemid"]."&hostid=".$_REQUEST["hostid"]."®ister=changestatus&status=0\">".S_NOT_ACTIVE."</a>","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="<input class=\"button\" type=\"submit\" name=\"register\" value=\"Activate selected\" onClick=\"return Confirm('".S_ACTIVATE_SELECTED_ITEMS_Q."');\">"; - $h=$h."<input class=\"button\" type=\"submit\" name=\"register\" value=\"Disable selected\" onClick=\"return Confirm('".S_DISABLE_SELECTED_ITEMS_Q."');\">"; - $h=$h."<input class=\"button\" type=\"submit\" name=\"register\" value=\"Delete selected\" onClick=\"return Confirm('".S_DELETE_SELECTED_ITEMS_Q."');\">"; - $h=$h."</form>"; + $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="<input class=\"button\" type=\"submit\" name=\"register\" value=\"Activate selected\" onClick=\"return Confirm('".S_ACTIVATE_SELECTED_ITEMS_Q."');\">"; +// $h=$h."<input class=\"button\" type=\"submit\" name=\"register\" value=\"Disable selected\" onClick=\"return Confirm('".S_DISABLE_SELECTED_ITEMS_Q."');\">"; +// $h=$h."<input class=\"button\" type=\"submit\" name=\"register\" value=\"Delete selected\" onClick=\"return Confirm('".S_DELETE_SELECTED_ITEMS_Q."');\">"; +// $h=$h."</form>"; + +// show_table_header($h); } } |
