Apply "Squiz" code style on old (pre-2014) files

This commit is contained in:
Job Snijders
2015-07-10 13:36:21 +02:00
parent e4f4eb44dc
commit ebd0f6fc35
539 changed files with 13591 additions and 13223 deletions

View File

@@ -1,64 +1,77 @@
<?php
$link_array = array('page' => 'device',
'device' => $device['device_id'],
'tab' => 'routing',
'proto' => 'vrf');
$link_array = array(
'page' => 'device',
'device' => $device['device_id'],
'tab' => 'routing',
'proto' => 'vrf',
);
#echo(generate_link("Basic", $link_array,array('view'=>'basic')));
if(!isset($vars['view'])) { $vars['view'] = "basic"; }
// echo(generate_link("Basic", $link_array,array('view'=>'basic')));
if (!isset($vars['view'])) {
$vars['view'] = 'basic';
}
print_optionbar_start();
echo("<span style='font-weight: bold;'>VRFs</span> &#187; ");
echo "<span style='font-weight: bold;'>VRFs</span> &#187; ";
$menu_options = array('basic' => 'Basic',
# 'detail' => 'Detail',
);
// 'detail' => 'Detail',
);
if (!$_GET['opta']) { $_GET['opta'] = "basic"; }
if (!$_GET['opta']) {
$_GET['opta'] = 'basic';
}
$sep = "";
foreach ($menu_options as $option => $text)
{
if ($vars['view'] == $option) { echo("<span class='pagemenu-selected'>"); }
echo(generate_link($text, $link_array,array('view'=>$option)));
if ($vars['view'] == $option) { echo("</span>"); }
echo(" | ");
$sep = '';
foreach ($menu_options as $option => $text) {
if ($vars['view'] == $option) {
echo "<span class='pagemenu-selected'>";
}
echo generate_link($text, $link_array, array('view' => $option));
if ($vars['view'] == $option) {
echo '</span>';
}
echo ' | ';
}
unset($sep);
echo(' Graphs: ');
echo ' Graphs: ';
$graph_types = array("bits" => "Bits",
"upkts" => "Unicast Packets",
"nupkts" => "Non-Unicast Packets",
"errors" => "Errors",
"etherlike" => "Etherlike");
$graph_types = array(
'bits' => 'Bits',
'upkts' => 'Unicast Packets',
'nupkts' => 'Non-Unicast Packets',
'errors' => 'Errors',
'etherlike' => 'Etherlike',
);
foreach ($graph_types as $type => $descr)
{
echo("$type_sep");
if ($vars['graph'] == $type) { echo("<span class='pagemenu-selected'>"); }
echo(generate_link($descr, $link_array,array('view'=>'graphs','graph'=>$type)));
if ($vars['graph'] == $type) { echo("</span>"); }
foreach ($graph_types as $type => $descr) {
echo "$type_sep";
if ($vars['graph'] == $type) {
echo "<span class='pagemenu-selected'>";
}
$type_sep = " | ";
echo generate_link($descr, $link_array, array('view' => 'graphs', 'graph' => $type));
if ($vars['graph'] == $type) {
echo '</span>';
}
$type_sep = ' | ';
}
print_optionbar_end();
echo("<div style='margin: 5px;'><table border=0 cellspacing=0 cellpadding=5 width=100%>");
$i = "0";
foreach (dbFetchRows("SELECT * FROM `vrfs` WHERE `device_id` = ? ORDER BY `vrf_name`", array($device['device_id'])) as $vrf)
{
include("includes/print-vrf.inc.php");
echo "<div style='margin: 5px;'><table border=0 cellspacing=0 cellpadding=5 width=100%>";
$i = '0';
foreach (dbFetchRows('SELECT * FROM `vrfs` WHERE `device_id` = ? ORDER BY `vrf_name`', array($device['device_id'])) as $vrf) {
include 'includes/print-vrf.inc.php';
$i++;
$i++;
}
echo("</table></div>");
?>
echo '</table></div>';