neatify generate_graph_tag

git-svn-id: http://www.observium.org/svn/observer/trunk@2142 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-04-22 20:46:19 +00:00
parent 95ab5ad3ac
commit 38fe6e2e03

View File

@@ -195,27 +195,22 @@ function device_permitted($device_id)
return $allowed; return $allowed;
} }
function print_graph_tag ($args) function print_graph_tag($args)
{ {
echo(generate_graph_tag ($args)); echo(generate_graph_tag($args));
} }
function generate_graph_tag ($args) function generate_graph_tag($args)
{ {
global $config;
$sep = "?";
$url = "graph.php";
foreach ($args as $key => $arg) foreach ($args as $key => $arg)
{ {
$url .= $sep.$key."=".$arg; $urlargs[] = $key."=".$arg;
$sep="&";
} }
return "<img src=\"".$url."\" border=0>"; return '<img src="graph.php?' . implode('&amp;',$urlargs).'" border="0" />';
} }
function print_percentage_bar ($width, $height, $percent, $left_text, $left_colour, $left_background, $right_text, $right_colour, $right_background) function print_percentage_bar($width, $height, $percent, $left_text, $left_colour, $left_background, $right_text, $right_colour, $right_background)
{ {
$output = ' $output = '
<div style="font-size:11px;"> <div style="font-size:11px;">