new menu style for services and device/ports

git-svn-id: http://www.observium.org/svn/observer/trunk@2046 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-04-09 15:20:07 +00:00
parent e25e9699bc
commit af757d6246
3 changed files with 102 additions and 62 deletions
+31 -9
View File
@@ -7,11 +7,26 @@ if ($_GET['opta'] == 'graphs')
print_optionbar_start();
echo("<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/'>Basic</a> |
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/details/'>Details</a> |
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/arp/'>ARP Table</a> |
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/adsl/'>ADSL</a> |
Graphs: ");
$menu_options = array('basic' => 'Basic',
'details' => 'Details',
'arp' => 'ARP Table',
'adsl' => 'ADSL');
if (!$_GET['opta']) { $_GET['opta'] = "basic"; }
$sep = "";
foreach ($menu_options as $option => $text)
{
echo($sep);
if ($_GET['opta'] == $option) { echo("<span class='pagemenu-selected'>"); }
echo('<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/ports/' . $option . ($_GET['optb'] ? '/' . $_GET['optb'] : ''). '/">' . $text . '</a>');
if ($_GET['opta'] == $option) { echo("</span>"); }
$sep = " | ";
}
unset($sep);
echo('Graphs: ');
$graph_types = array("bits" => "Bits",
"upkts" => "Unicast Packets",
@@ -21,9 +36,16 @@ $graph_types = array("bits" => "Bits",
foreach ($graph_types as $type => $descr)
{
echo("$type_sep
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/graphs/$type/'>$descr</a>
(<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/graphs/$type/thumbs/'>Mini</a>) ");
echo("$type_sep");
if ($_GET['optb'] == $type && $_GET['optc'] != "thumbs") { echo("<span class='pagemenu-selected'>"); }
echo('<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/ports/graphs/'.$type.'/">'.$descr.'</a>');
if ($_GET['optb'] == $type && $_GET['optc'] != "thumbs") { echo("</span>"); }
echo('(');
if ($_GET['optb'] == $type && $_GET['optc'] == "thumbs") { echo("<span class='pagemenu-selected'>"); }
echo('<a href="'.$config['base_url'].'/device/' . $device['device_id'] . '/ports/graphs/'.$type.'/thumbs/">Mini</a>');
if ($_GET['optb'] == $type && $_GET['optc'] == "thumbs") { echo("</span>"); }
echo(')');
$type_sep = " | ";
}
@@ -84,4 +106,4 @@ if ($_GET['optc'] == thumbs)
}
}
?>
?>
+21 -3
View File
@@ -1,9 +1,27 @@
<?php print_optionbar_start();
$menu_options = array('basic' => 'Basic',
'details' => 'Details');
if (!$_GET['opta']) { $_GET['opta'] = "basic"; }
echo("<a href='".$config['base_url']."/services/basic/'>Basic</a> | ");
echo("<a href='".$config['base_url']."/services/details/'>Details</a>");
$sep = "";
foreach ($menu_options as $option => $text)
{
echo($sep);
if ($_GET['opta'] == $option)
{
echo("<span class='pagemenu-selected'>");
}
echo('<a href="'.$config['base_url'].'/services/' . $option . ($_GET['optb'] ? '/' . $_GET['optb'] : ''). '/">' . $text . '</a>');
if ($_GET['opta'] == $option)
{
echo("</span>");
}
$sep = " | ";
}
unset($sep);
print_optionbar_end();
@@ -54,4 +72,4 @@ if ($_SESSION['userlevel'] >= '5')
echo("</table></div>");
?>
?>