device subpages cleanup, remove dead code

git-svn-id: http://www.observium.org/svn/observer/trunk@1896 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-03-16 23:10:10 +00:00
parent b3dc4c3129
commit 1a477eebbe
57 changed files with 1070 additions and 1059 deletions
+10 -13
View File
@@ -11,18 +11,19 @@ print_optionbar_start('', '');
$sep = "";
$query = mysql_query("SELECT * FROM device_graphs WHERE device_id = '".$device['device_id']."'");
while($graph = mysql_fetch_assoc($query))
while ($graph = mysql_fetch_assoc($query))
{
$section = $config['graph_types']['device'][$graph['graph']]['section'];
$graph_enable[$section][$graph['graph']] = $graph['graph'];
}
foreach($config['graph_sections'] as $section)
foreach ($config['graph_sections'] as $section)
{
if(isset($graph_enable) && is_array($graph_enable[$section]))
if (isset($graph_enable) && is_array($graph_enable[$section]))
{
$type = strtolower($section);
if(!$_GET['opta']) { $_GET['opta'] = $type; }
if (!$_GET['opta']) { $_GET['opta'] = $type; }
echo($sep);
if ($_GET['opta'] == $type)
{
@@ -33,24 +34,21 @@ foreach($config['graph_sections'] as $section)
{
echo('<img src="images/icons/greyscale/'.$type.'.png" class="optionicon" />');
}
echo("<a href='".$config['base_url']."/device/".$device['device_id']."/graphs/" . $type . ($_GET['optb'] ? "/" . $_GET['optb'] : ''). "/'> " . $type ."</a>\n");
if ($_GET['opta'] == $type) { echo("</strong>"); }
$sep = " | ";
}
}
unset ($sep);
print_optionbar_end();
#echo("<pre>");
#print_r($_GET['opta']);
#print_r($graph_enable);
#echo("</pre>");
$graph_enable = $graph_enable[$_GET['opta']];
foreach($config['graph_types']['device'] as $graph => $entry)
foreach ($config['graph_types']['device'] as $graph => $entry)
{
if($graph_enable[$graph])
if ($graph_enable[$graph])
{
$graph_title = $config['graph_types']['device'][$graph]['descr'];
$graph_type = "device_" . $graph;
@@ -58,5 +56,4 @@ foreach($config['graph_types']['device'] as $graph => $entry)
}
}
?>
?>