From d329d5872ccb034f292d37acd0b8094a282e047c Mon Sep 17 00:00:00 2001 From: Darren Embry Date: Thu, 6 Sep 2012 14:04:47 -0400 Subject: a few coding indentation/style fixes. --- usr/local/www/guiconfig.inc | 124 ++++++++++++++++++++++---------------------- 1 file changed, 61 insertions(+), 63 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc index 6c4ae29..978745b 100755 --- a/usr/local/www/guiconfig.inc +++ b/usr/local/www/guiconfig.inc @@ -1027,37 +1027,37 @@ function alias_info_popup($alias_id){ exec("/sbin/pfctl -t {$alias_name['name']} -T show | head -10002", $alias_addresses); $alias_objects_with_details .= "{$alias_name['url']}"; $x=0; - foreach ($alias_addresses as $alias_ports_address ){ - switch ($x){ - case 0: - $x++; - $alias_objects_with_details .= "{$alias_ports_address}"; - break; - case 1: - $x++; - $alias_objects_with_details .= "{$alias_ports_address}"; - break; - default: - $x=0; - $alias_objects_with_details .= "{$alias_ports_address}"; - break; - } - } - for ($y=$x;$y<=$x;$y++){ - $alias_objects_with_details .= " "; - } - if ($x > 0) - $alias_objects_with_details .= ""; - if ($counter > 10002){ - $alias_objects_with_details .= " listing only first 10k items"; + foreach ($alias_addresses as $alias_ports_address ) { + switch ($x) { + case 0: + $x++; + $alias_objects_with_details .= "{$alias_ports_address}"; + break; + case 1: + $x++; + $alias_objects_with_details .= "{$alias_ports_address}"; + break; + default: + $x=0; + $alias_objects_with_details .= "{$alias_ports_address}"; + break; } } + for ($y = $x; $y <= $x; $y++) { + $alias_objects_with_details .= " "; + } + if ($x > 0) { + $alias_objects_with_details .= ""; + } + if ($counter > 10002) { + $alias_objects_with_details .= " listing only first 10k items"; + } + } else{ $alias_addresses = explode (" ", $alias_name['address']); $alias_details = explode ("||", $alias_name['detail']); - $counter=0; - foreach($alias_addresses as $alias_ports_address) - { + $counter = 0; + foreach ($alias_addresses as $alias_ports_address) { $alias_objects_with_details .= "{$alias_addresses[$counter]}"; $alias_detail_default = strpos ($alias_details[$counter],"Entry added"); if ($alias_details[$counter] != "" && $alias_detail_default === False) @@ -1066,50 +1066,48 @@ function alias_info_popup($alias_id){ $alias_objects_with_details .=" "; $alias_objects_with_details .= ""; $counter++; - } - - } - $alias_objects_with_details .=""; + } } - $alias_descr_substr = $alias_name['descr']; - if ($strlength >= $maxlength) - $alias_descr_substr = substr($alias_descr_substr, 0, $maxlength) . "..."; - $item_text=($counter > 1 ? "items" : "item"); - $alias_caption = "{$alias_descr_substr} - {$counter} {$item_text}  edit "; - $strlength = strlen ($alias_caption); - print "

{$alias_caption}

".$alias_objects_with_details; + $alias_objects_with_details .= ""; + } + $alias_descr_substr = $alias_name['descr']; + if ($strlength >= $maxlength) + $alias_descr_substr = substr($alias_descr_substr, 0, $maxlength) . "..."; + $item_text = ($counter > 1 ? "items" : "item"); + $alias_caption = "{$alias_descr_substr} - {$counter} {$item_text}  edit "; + $strlength = strlen ($alias_caption); + print "

{$alias_caption}

" . $alias_objects_with_details; } function rule_popup($src,$srcport,$dst,$dstport){ global $config,$g; $aliases_array = array(); - if($config['aliases']['alias'] <> "" and is_array($config['aliases']['alias'])) - { + if ($config['aliases']['alias'] <> "" and is_array($config['aliases']['alias'])) { $descriptions = array (); - foreach($config['aliases']['alias'] as $alias_id=>$alias_name){ - $loading_image=" " .gettext("loading...").""; - switch ($alias_name['type']){ - case "port": - $width="250"; - break; - case "urltable": - $width="500"; - break; - default: - $width="350"; - break; - } - $span_begin = ""; - if ($alias_name['name'] == $src) - $descriptions['src']= $span_begin; - if ($alias_name['name'] == $srcport) - $descriptions['srcport'] = $span_begin; - if ($alias_name['name'] == $dst ) - $descriptions['dst'] = $span_begin; - if ($alias_name['name'] == $dstport) - $descriptions['dstport'] = $span_begin; - } - return $descriptions; + foreach ($config['aliases']['alias'] as $alias_id=>$alias_name){ + $loading_image=" " .gettext("loading...").""; + switch ($alias_name['type']){ + case "port": + $width="250"; + break; + case "urltable": + $width="500"; + break; + default: + $width="350"; + break; + } + $span_begin = ""; + if ($alias_name['name'] == $src) + $descriptions['src']= $span_begin; + if ($alias_name['name'] == $srcport) + $descriptions['srcport'] = $span_begin; + if ($alias_name['name'] == $dst ) + $descriptions['dst'] = $span_begin; + if ($alias_name['name'] == $dstport) + $descriptions['dstport'] = $span_begin; + } + return $descriptions; } } -- cgit v1.1