had to pull WxH out into vars to use in the image tag

This commit is contained in:
Travis Hegner
2015-06-29 12:54:31 -04:00
parent 771c08f2e6
commit e6ab9b4b60

View File

@@ -337,12 +337,23 @@ function print_graph_tag($args)
function generate_graph_tag($args)
{
$urlargs = array();
$w = 0;
$h = 0;
foreach ($args as $key => $arg)
{
if(strtolower($key) == 'width')
$w = $arg;
switch (strtolower($key)) {
case 'width':
$w = $arg;
break;
case 'height':
$h = $arg;
}
$urlargs[] = $key."=".urlencode($arg);
}
return '<img class="lazy" width="216" height="100" src="graph.php?' . implode('&amp;',$urlargs).'" border="0" />';
return '<img class="lazy" width="'.$w.'" height="'.$h.'" src="graph.php?' . implode('&amp;',$urlargs).'" border="0" />';
}
function generate_graph_js_state($args) {