Tidy up formatting; proof-of-concept right side box

This commit is contained in:
Paul Gear
2013-11-19 08:57:43 +10:00
parent afd68473b4
commit a0979e85cd
10 changed files with 427 additions and 36 deletions
+10 -5
View File
@@ -79,17 +79,22 @@ function generate_url($vars, $new_vars = array())
}
function escape_quotes($text)
{
return str_replace('"', "\'", $text);
}
function generate_overlib_content($graph_array, $text)
{
global $config;
$overlib_content = '<div class=overlib><span class=overlib-text>'.$text."</span><br />";
$overlib_content = '<div class=overlib><span class=overlib-text>'.$text.'</span><br />';
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 .= escape_quotes(generate_graph_tag($graph_array));
}
$overlib_content .= "</div>";
$overlib_content .= '</div>';
return $overlib_content;
@@ -159,8 +164,8 @@ function generate_device_link($device, $text=NULL, $vars=array(), $start=0, $end
$graphhead = $entry['text'];
$contents .= '<div class=overlib-box>';
$contents .= '<span class=overlib-title>'.$graphhead.'</span><br />';
$contents .= generate_minigraph_image($device, $start, $end, $graph);
$contents .= generate_minigraph_image($device, $config['time']['week'], $end, $graph);
$contents .= escape_quotes(generate_minigraph_image($device, $start, $end, $graph));
$contents .= escape_quotes(generate_minigraph_image($device, $config['time']['week'], $end, $graph));
$contents .= '</div>';
}