[Koha-cvs] CVS: koha/search.marc search.pl,1.4,1.5

Ambrose Li acli at users.sourceforge.net
Thu Feb 6 08:05:53 CET 2003


Update of /cvsroot/koha/koha/search.marc
In directory sc8-pr-cvs1:/tmp/cvs-serv382/search.marc

Modified Files:
	search.pl 
Log Message:
Minor visual tweaks
Noted correct tab size


Index: search.pl
===================================================================
RCS file: /cvsroot/koha/koha/search.marc/search.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** search.pl	3 Feb 2003 18:46:04 -0000	1.4
--- search.pl	6 Feb 2003 07:05:51 -0000	1.5
***************
*** 1,3 ****
--- 1,4 ----
  #!/usr/bin/perl
+ # WARNING: 4-character tab stops here
  
  # Copyright 2000-2002 Katipo Communications
***************
*** 90,100 ****
  	my @marcarray;
  	push @marcarray,"";
! 	for (my $tabloop = 0; $tabloop<=9;$tabloop++) {
! 	push @marcarray,"--------------------------------------- $tabloop ---------------------------------------";
! 		foreach my $tag (sort(keys (%{$tagslib}))) {
! 			foreach my $subfield (sort(keys %{$tagslib->{$tag}})) {
! 				next if subfield_is_koha_internal_p($subfield);
! 				next unless ($tagslib->{$tag}->{$subfield}->{tab} eq $tabloop);
! 				push @marcarray, "$tag$subfield - $tagslib->{$tag}->{$subfield}->{lib}";
  			}
  		}
--- 91,116 ----
  	my @marcarray;
  	push @marcarray,"";
! 	my $widest_menu_item_width = 0;
! 	for (my $pass = 1; $pass <= 2; $pass += 1) {
! 		for (my $tabloop = 0; $tabloop<=9;$tabloop++) {
! 			my $separator_inserted_p = 0; # FIXME... should not use!!
! 			foreach my $tag (sort(keys (%{$tagslib}))) {
! 				foreach my $subfield (sort(keys %{$tagslib->{$tag}})) {
! 					next if subfield_is_koha_internal_p($subfield);
! 					next unless ($tagslib->{$tag}->{$subfield}->{tab} eq $tabloop);
! 					my $menu_item = "$tag$subfield - $tagslib->{$tag}->{$subfield}->{lib}";
! 					if ($pass == 1) {
! 						$widest_menu_item_width = length $menu_item
! 								if $widest_menu_item_width < length $menu_item;
! 					} else {
! 						if (!$separator_inserted_p) {
! 							my $w = int(($widest_menu_item_width - 3 + 0.5)/2);
! 							my $s = ('-' x ($w * 4/5));
! 							push @marcarray,  "$s $tabloop $s";
! 							$separator_inserted_p = 1;
! 						}
! 						push @marcarray, $menu_item;
! 					}
! 				}
  			}
  		}
***************
*** 110,111 ****
--- 126,132 ----
  # Print the page
  output_html_with_http_headers $query, $cookie, $template->output;
+ 
+ 
+ # Local Variables:
+ # tab-width: 4
+ # End:





More information about the Koha-cvs mailing list