diff --git a/squid/edit_icp.cgi b/squid/edit_icp.cgi index 460466057..264e34ca2 100755 --- a/squid/edit_icp.cgi +++ b/squid/edit_icp.cgi @@ -2,192 +2,191 @@ # edit_icp.cgi # A form for editing options for communication with other caches +use strict; +use warnings; +our (%text, %in, %access, $squid_version, %config); require './squid-lib.pl'; $access{'othercaches'} || &error($text{'eicp_ecannot'}); &ui_print_header(undef, $text{'eicp_header'}, "", "edit_icp", 0, 0, 0, &restart_button()); -$conf = &get_config(); -$cache_host = $squid_version >= 2 ? "cache_peer" : "cache_host"; +my $conf = &get_config(); +my $cache_host = $squid_version >= 2 ? "cache_peer" : "cache_host"; -@ch = &find_config($cache_host, $conf); -@links = ( &select_all_link("d"), - &select_invert_link("d"), - "$text{'eicp_aac'}" ); +my @ch = &find_config($cache_host, $conf); +my @links = ( &select_all_link("d"), + &select_invert_link("d"), + "$text{'eicp_aac'}" ); if (@ch) { - #print &ui_subheading($text{'eicp_opcs'}); - $mid = int((@ch+1)/2); + my $mid = int((@ch+1)/2); print &ui_form_start("delete_icps.cgi", "post"); print &ui_links_row(\@links); print "
| \n"; - &cache_table(0, $mid-1); + print &cache_table(0, $mid-1, \@ch); print " | \n"; - if ($mid < @ch) { &cache_table($mid, $#ch); } + if ($mid < @ch) { + print &cache_table($mid, $#ch, \@ch); + } print " |
\n"; + print "$text{'eicp_nocd'}
\n"; print &ui_links_row([ $links[2] ]); } print &ui_hr(); -print "
\n"; +print &ui_table_end(); +print &ui_form_end([ [ undef, $text{'buttsave'} ] ]); &ui_print_footer("", $text{'eicp_return'}); -# cache_table(start, end) +# cache_table(start, end, &caches) sub cache_table { -local @tds = ( "width=5" ); -print &ui_columns_start([ "", - $text{'eicp_thost'}, - $text{'eicp_ttype'}, - $text{'eicp_tpport'}, - $text{'eicp_tiport'} ], 100, 0, \@tds); -for($i=$_[0]; $i<=$_[1]; $i++) { - @chv = @{$ch[$i]->{'values'}}; +my ($start, $end, $ch) = @_; +my @tds = ( "width=5" ); +my $rv = &ui_columns_start([ "", + $text{'eicp_thost'}, + $text{'eicp_ttype'}, + $text{'eicp_tpport'}, + $text{'eicp_tiport'} ], 100, 0, \@tds); +for(my $i=$start; $i<=$end; $i++) { + my @chv = @{$ch->[$i]->{'values'}}; print &ui_checked_columns_row([ - "". - &html_escape($chv[0])."", + &ui_link("edit_cache_host.cgi?num=$i", + &html_escape($chv[0])), &html_escape($chv[1]), &html_escape($chv[2]), &html_escape($chv[3]) diff --git a/squid/edit_ports.cgi b/squid/edit_ports.cgi index 53a6cffd4..58e1c3ca6 100755 --- a/squid/edit_ports.cgi +++ b/squid/edit_ports.cgi @@ -15,15 +15,13 @@ print &ui_table_start($text{'eports_pano'}, "width=100%", 4); if ($squid_version >= 2.3) { # Display table of normal ports - print "