diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-02-13 14:39:13 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-02-13 14:39:13 +0000 |
| commit | 42858cb993ece4f6cdf86d3bc77a3e0451e2a66a (patch) | |
| tree | ed54d37750ea42c92aaa05eb22ea8adb39ab8e82 /frontends/php | |
| parent | 243d617eb24a7ba56683fcc976701064720181ba (diff) | |
- fixed navigation bar for Sreens (Eugene)
(http://www.zabbix.com/forum/showthread.php?t=2148)
git-svn-id: svn://svn.zabbix.com/trunk@2637 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php')
| -rw-r--r-- | frontends/php/include/graphs.inc.php | 56 | ||||
| -rw-r--r-- | frontends/php/include/html.inc.php | 10 | ||||
| -rw-r--r-- | frontends/php/include/validate.inc.php | 22 | ||||
| -rw-r--r-- | frontends/php/screens.php | 18 |
4 files changed, 59 insertions, 47 deletions
diff --git a/frontends/php/include/graphs.inc.php b/frontends/php/include/graphs.inc.php index 0963cbbb..709b37ab 100644 --- a/frontends/php/include/graphs.inc.php +++ b/frontends/php/include/graphs.inc.php @@ -508,41 +508,41 @@ $h2=$h2.form_select("period",365*24*3600,"year"); $h2=$h2."</select>"; $h2=$h2."<select class=\"biginput\" name=\"dec\" onChange=\"submit()\">"; - $h2=$h2.form_select("dec",0,S_DECREASE); - $h2=$h2.form_select("dec",3600,"-1h"); - $h2=$h2.form_select("dec",4*3600,"-4h"); - $h2=$h2.form_select("dec",24*3600,"-24h"); - $h2=$h2.form_select("dec",7*24*3600,"-week"); - $h2=$h2.form_select("dec",31*24*3600,"-month"); - $h2=$h2.form_select("dec",365*24*3600,"-year"); + $h2=$h2.form_select(NULL,0,S_DECREASE); + $h2=$h2.form_select(NULL,3600,"-1h"); + $h2=$h2.form_select(NULL,4*3600,"-4h"); + $h2=$h2.form_select(NULL,24*3600,"-24h"); + $h2=$h2.form_select(NULL,7*24*3600,"-week"); + $h2=$h2.form_select(NULL,31*24*3600,"-month"); + $h2=$h2.form_select(NULL,365*24*3600,"-year"); $h2=$h2."</select>"; $h2=$h2."<select class=\"biginput\" name=\"inc\" onChange=\"submit()\">"; - $h2=$h2.form_select("inc",0,S_INCREASE); - $h2=$h2.form_select("inc",3600,"+1h"); - $h2=$h2.form_select("inc",4*3600,"+4h"); - $h2=$h2.form_select("inc",24*3600,"+24h"); - $h2=$h2.form_select("inc",7*24*3600,"+week"); - $h2=$h2.form_select("inc",31*24*3600,"+month"); - $h2=$h2.form_select("inc",365*24*3600,"+year"); + $h2=$h2.form_select(NULL,0,S_INCREASE); + $h2=$h2.form_select(NULL,3600,"+1h"); + $h2=$h2.form_select(NULL,4*3600,"+4h"); + $h2=$h2.form_select(NULL,24*3600,"+24h"); + $h2=$h2.form_select(NULL,7*24*3600,"+week"); + $h2=$h2.form_select(NULL,31*24*3600,"+month"); + $h2=$h2.form_select(NULL,365*24*3600,"+year"); $h2=$h2."</select>"; $h2=$h2.SPACE.S_MOVE.SPACE; $h2=$h2."<select class=\"biginput\" name=\"left\" onChange=\"submit()\">"; - $h2=$h2.form_select("left",0,S_LEFT_DIR); - $h2=$h2.form_select("left",1,"-1h"); - $h2=$h2.form_select("left",4,"-4h"); - $h2=$h2.form_select("left",24,"-24h"); - $h2=$h2.form_select("left",7*24,"-week"); - $h2=$h2.form_select("left",31*24,"-month"); - $h2=$h2.form_select("left",365*24,"-year"); + $h2=$h2.form_select(NULL,0,S_LEFT_DIR); + $h2=$h2.form_select(NULL,1,"-1h"); + $h2=$h2.form_select(NULL,4,"-4h"); + $h2=$h2.form_select(NULL,24,"-24h"); + $h2=$h2.form_select(NULL,7*24,"-week"); + $h2=$h2.form_select(NULL,31*24,"-month"); + $h2=$h2.form_select(NULL,365*24,"-year"); $h2=$h2."</select>"; $h2=$h2."<select class=\"biginput\" name=\"right\" onChange=\"submit()\">"; - $h2=$h2.form_select("right",0,S_RIGHT_DIR); - $h2=$h2.form_select("right",1,"+1h"); - $h2=$h2.form_select("right",4,"+4h"); - $h2=$h2.form_select("right",24,"+24h"); - $h2=$h2.form_select("right",7*24,"+week"); - $h2=$h2.form_select("right",31*24,"+month"); - $h2=$h2.form_select("right",365*24,"+year"); + $h2=$h2.form_select(NULL,0,S_RIGHT_DIR); + $h2=$h2.form_select(NULL,1,"+1h"); + $h2=$h2.form_select(NULL,4,"+4h"); + $h2=$h2.form_select(NULL,24,"+24h"); + $h2=$h2.form_select(NULL,7*24,"+week"); + $h2=$h2.form_select(NULL,31*24,"+month"); + $h2=$h2.form_select(NULL,365*24,"+year"); $h2=$h2."</select>"; $h2=$h2.SPACE; $h2=$h2."<input name=\"stime\" size=18 class=\"biginput\" value=\"yyyymmddhhmm\" size=12>"; diff --git a/frontends/php/include/html.inc.php b/frontends/php/include/html.inc.php index 4c888aaa..23ac7cb8 100644 --- a/frontends/php/include/html.inc.php +++ b/frontends/php/include/html.inc.php @@ -50,8 +50,14 @@ function form_select($var, $value, $label) { global $_REQUEST; - - return "<option value=\"$value\" ".iif(isset($_REQUEST[$var])&&$_REQUEST[$var]==$value,"selected","").">$label"; + + $selected = ""; + if(!is_null($var)) + { + if(isset($_REQUEST[$var])&&$_REQUEST[$var]==$value) + $selected = "selected"; + } + return "<option value=\"$value\" $selected>$label"; } function form_input($name, $value, $size) diff --git a/frontends/php/include/validate.inc.php b/frontends/php/include/validate.inc.php index 4de30e9a..39e9a66f 100644 --- a/frontends/php/include/validate.inc.php +++ b/frontends/php/include/validate.inc.php @@ -19,6 +19,13 @@ **/ ?> <?php + + function unset_request($key) + { +// SDI("unset: $key"); + unset($_REQUEST[$key]); + } + define('ZBX_VALID_OK', 0); define('ZBX_VALID_ERROR', 1); define('ZBX_VALID_WARNING', 2); @@ -100,8 +107,7 @@ { if(!isset($fields[$key])) { -//echo "Unset: $key<br>"; - unset($_REQUEST[$key]); + unset_request($key); } } } @@ -114,8 +120,7 @@ if(($flags&P_NZERO)&&(isset($_REQUEST[$field]))&&($_REQUEST[$field]==0)) { -//echo "Unset: $field<br>"; - unset($_REQUEST[$field]); + unset_request($field); } } } @@ -129,8 +134,7 @@ if(($flags&P_ACT)&&(isset($_REQUEST[$field]))) { -//echo "Unset:".$field."<br>"; - unset($_REQUEST[$field]); + unset_request($field); } } } @@ -139,8 +143,7 @@ { foreach($_REQUEST as $key => $val) { -//echo "Unset:".$key."<br>"; - unset($_REQUEST[$key]); + unset_request($key); } } @@ -231,8 +234,7 @@ if(!isset($_REQUEST[$field])) return ZBX_VALID_OK; -//echo "Unset:".$field."<br>"; - unset($_REQUEST[$field]); + unset_request($field); if($flags&P_SYS) { diff --git a/frontends/php/screens.php b/frontends/php/screens.php index 23a5f892..830a917b 100644 --- a/frontends/php/screens.php +++ b/frontends/php/screens.php @@ -20,6 +20,8 @@ ?> <?php include "include/config.inc.php"; + + $page["title"] = "S_CUSTOM_SCREENS"; $page["file"] = "screens.php"; @@ -39,16 +41,14 @@ ?> <?php - $effectiveperiod=navigation_bar_calc(); -?> - -<?php // VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION $fields=array( "screenid"=> array(T_ZBX_INT, O_OPT, P_SYS|P_NZERO, DB_ID,NULL), "dec"=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535*65535),NULL), "inc"=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535*65535),NULL), "from"=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535*65535),NULL), + "left"=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535*65535),NULL), + "right"=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535*65535),NULL), "period"=> array(T_ZBX_INT, O_OPT, P_SYS, BETWEEN(0,65535*65535),NULL), "stime"=> array(T_ZBX_STR, O_OPT, P_SYS, NULL,NULL), "action"=> array(T_ZBX_STR, O_OPT, P_SYS, IN("'go'"),NULL), @@ -60,6 +60,10 @@ ?> <?php + $effectiveperiod=navigation_bar_calc(); +?> + +<?php $_REQUEST["screenid"]=get_request("screenid",get_profile("web.screens.screenid",0)); update_profile("web.screens.screenid",$_REQUEST["screenid"]); update_profile("web.menu.view.last",$page["file"]); @@ -196,7 +200,7 @@ { $item = new CLink( new CImg("chart2.php?graphid=$resourceid&width=$width&height=$height". - "&period=3600' border=0"), + "&period=$effectiveperiod".url_param("stime").url_param("from")), "charts.php?graphid=$resourceid".url_param("period"). url_param("inc").url_param("dec") ); @@ -205,7 +209,7 @@ { $item = new CLink( new CImg("chart.php?itemid=$resourceid&width=$width&height=$height". - "&period=3600"), + "&period=$effectiveperiod".url_param("stime").url_param("from")), "history.php?action=showhistory&itemid=$resourceid". url_param("period").url_param("inc").url_param("dec") ); @@ -213,7 +217,7 @@ else if( ($screenitemid!=0) && ($resource==2) ) { $item = new CImg("map.php?noedit=1&sysmapid=$resourceid". - "&width=$width&height=$height&period=3600"); + "&width=$width&height=$height"); } else if( ($screenitemid!=0) && ($resource==3) ) { |
