summaryrefslogtreecommitdiffstats
path: root/frontends/php/include
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-02-01 15:43:49 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-02-01 15:43:49 +0000
commit222b652b3e10a33f460c222320685d3e75fd9756 (patch)
tree2aedee556edc1a0224c4bb96d04962c953cb529f /frontends/php/include
parentcb5a8201693fba5ae897caf8f0e22db9d6f2ce16 (diff)
downloadzabbix-222b652b3e10a33f460c222320685d3e75fd9756.tar.gz
zabbix-222b652b3e10a33f460c222320685d3e75fd9756.tar.xz
zabbix-222b652b3e10a33f460c222320685d3e75fd9756.zip
improved interface for webmonitoring
git-svn-id: svn://svn.zabbix.com/trunk@3787 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'frontends/php/include')
-rw-r--r--frontends/php/include/classes/cimg.inc.php11
-rw-r--r--frontends/php/include/config.inc.php39
-rw-r--r--frontends/php/include/page_header.php2
3 files changed, 46 insertions, 6 deletions
diff --git a/frontends/php/include/classes/cimg.inc.php b/frontends/php/include/classes/cimg.inc.php
index f7cb42c8..bc1f130b 100644
--- a/frontends/php/include/classes/cimg.inc.php
+++ b/frontends/php/include/classes/cimg.inc.php
@@ -22,7 +22,7 @@
class CImg extends CTag
{
/* public */
- function CImg($src,$alt_text=NULL,$width=NULL,$height=NULL,$class=NULL)
+ function CImg($src,$name=NULL,$width=NULL,$height=NULL,$class=NULL)
{
parent::CTag("img","no");
@@ -31,8 +31,12 @@
$this->tag_body_start = "";
$this->tag_body_end = "";
+ if(is_null($name))
+ $name="image";
+
$this->AddOption('border',0);
- $this->SetAltText($alt_text);
+ $this->SetName($name);
+ $this->SetAltText($name);
$this->SetSrc($src);
$this->SetWidth($width);
$this->SetHeight($height);
@@ -48,9 +52,6 @@
}
function SetAltText($value=NULL)
{
- if(is_null($value))
- $value="image";
-
if(!is_string($value))
{
return $this->error("Incorrect value for SetText [$value]");
diff --git a/frontends/php/include/config.inc.php b/frontends/php/include/config.inc.php
index 0bbb110a..a2d53239 100644
--- a/frontends/php/include/config.inc.php
+++ b/frontends/php/include/config.inc.php
@@ -1074,6 +1074,33 @@ else
echo "</center>";
}
+ function get_dynamic_chart($img_src,$width=0)
+ {
+ if(is_int($width) && $width > 0) $img_src.= url_param($width, false, 'width');
+$result =
+"<script language=\"JavaScript\" type=\"text/javascript\">
+<!--
+ var width = \"".((!(is_int($width) && $width > 0)) ? $width : '')."\";
+ var img_src = \"".$img_src."\";
+
+ if(width!=\"\")
+ {
+ var scr_width = 0;
+ if(document.body.clientWidth)
+ scr_width = document.body.clientWidth;
+ else
+ scr_width = document.width;
+
+ width = \"&width=\" + (scr_width - 100 + parseInt(width));
+ }
+
+ document.write(\"<IMG ALT=\\\"chart\\\" SRC=\\\"\" + img_src + width + \"\\\"/>\");
+
+-->
+</script>";
+ return $result;
+ }
+
function get_status()
{
global $DB_TYPE;
@@ -1571,6 +1598,18 @@ else if (document.getElementById)
}
return obj.value;
}
+
+ function ScaleChartToParenElement(obj_name)
+ {
+ var obj = document.getElementsByName(obj_name);
+
+ if(obj.length <= 0) throw "Can't find objects with name [" + obj_name +"]";
+
+ for(i = obj.length-1; i>=0; i--)
+ {
+ obj[i].src += "&width=" + (obj[i].parentNode.offsetWidth - obj[i].parentNode.offsetLeft - 10);
+ }
+ }
//-->
</script>
<?php
diff --git a/frontends/php/include/page_header.php b/frontends/php/include/page_header.php
index 7de0c349..ff21e5c5 100644
--- a/frontends/php/include/page_header.php
+++ b/frontends/php/include/page_header.php
@@ -112,10 +112,10 @@ COpt::profiling_start("page");
"label" => S_MONITORING,
"default_page_id" => 0,
"pages"=>array(
+ array("url"=>"overview.php" ,"label"=>S_OVERVIEW ),
array("url"=>"httpmon.php" ,"label"=>S_WEB ,
"sub_pages"=>array("httpdetails.php")
),
- array("url"=>"overview.php" ,"label"=>S_OVERVIEW ),
array("url"=>"latest.php" ,"label"=>S_LATEST_DATA ,
"sub_pages"=>array("history.php","chart.php")
),