'); echo('

' . $sensor_type . '

'); $i = '0'; echo(''); foreach ($sensors as $sensor) { if (is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; } ### FIXME - make this "four graphs in popup" a function/include and "small graph" a function. ### FIXME - So now we need to clean this up and move it into a function. Isn't it just "print-quadgraphs"? $graph_colour = str_replace("#", "", $row_colour); $graph_array = array(); $graph_array['height'] = "100"; $graph_array['width'] = "210"; $graph_array['to'] = $now; $graph_array['id'] = $sensor['sensor_id']; $graph_array['type'] = $graph_type; $graph_array['from'] = $day; $graph_array['legend'] = "no"; $link_array = $graph_array; $link_array['page'] = "graphs"; unset($link_array['height'], $link_array['width'], $link_array['legend']); $link = generate_url($link_array); $overlib_content = '

'.$device['hostname']." - ".$sensor['sensor_descr']."

"; foreach (array('day','week','month','year') as $period) { $graph_array['from'] = $config['time'][$period]; $overlib_content .= str_replace('"', "\'", generate_graph_tag($graph_array)); } $overlib_content .= "
"; $graph_array['width'] = 80; $graph_array['height'] = 20; $graph_array['bg'] = $graph_colour; $sensor_minigraph = generate_graph_tag($graph_array); $sensor['sensor_descr'] = truncate($sensor['sensor_descr'], 25, ''); echo(""); $i++; } echo("
".overlib_link($link, $sensor['sensor_descr'], $overlib_content)." ".overlib_link($link, $sensor_minigraph, $overlib_content)." ".overlib_link($link, " $sensor['sensor_limit'] ? "style='color: red'" : '') . '>' . $sensor['sensor_current'] . $sensor_unit . "", $overlib_content)."
"); echo(""); } ?>