--- loncom/interface/lonsearchcat.pm 2004/06/03 19:23:08 1.228 +++ loncom/interface/lonsearchcat.pm 2004/06/28 15:55:09 1.230 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.228 2004/06/03 19:23:08 matthew Exp $ +# $Id: lonsearchcat.pm,v 1.230 2004/06/28 15:55:09 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -570,7 +570,7 @@ sub print_basic_search_form { my ($r,$closebutton,$hidden_fields) = @_; my $result = ($ENV{'form.catalogmode'} ne 'groupsearch'); my $bodytag=&Apache::loncommon::bodytag('Search'). - &Apache::lonhtmlcommon::breadcrumbs(undef,'Searching','Searching', + &Apache::lonhtmlcommon::breadcrumbs(undef,'Searching','Search_Basic', undef,undef, $ENV{'form.catalogmode'} ne 'groupsearch'); my $scrout = &search_html_header().$bodytag; @@ -697,8 +697,9 @@ Prints the advanced search form. sub print_advanced_search_form{ my ($r,$closebutton,$hidden_fields) = @_; my $bodytag=&Apache::loncommon::bodytag('Advanced Catalog Search'). - &Apache::lonhtmlcommon::breadcrumbs(undef,'Searching','Searching', - undef,undef, + &Apache::lonhtmlcommon::breadcrumbs(undef,'Searching', + 'Search_Advanced', + undef,undef, $ENV{'form.catalogmode'} ne 'groupsearch'); my %lt=&Apache::lonlocal::texthash('srch' => 'Search', 'reset' => 'Reset', @@ -780,7 +781,7 @@ ENDHEADER $scrout.=''. &titlefield(&mt('Copyright/Distribution')).''. &Apache::lonmeta::selectbox('copyright', - '',, + $ENV{'form.copyright'}, \&Apache::loncommon::copyrightdescription, ( undef, &Apache::loncommon::copyrightids) @@ -788,7 +789,7 @@ ENDHEADER $scrout.=''. &titlefield(&mt('Language')).''. &Apache::lonmeta::selectbox('language', - 'notset',, + $ENV{'form.language'}, \&Apache::loncommon::languagedescription, ('any',&Apache::loncommon::languageids) ).''; @@ -1200,7 +1201,7 @@ sub parse_advanced_search { my @StatsFields = &statfields(); my @EvalFields = &evalfields(); my $fillflag=0; - my $pretty_search_string = "
\n"; + my $pretty_search_string = ""; # Clean up fields for safety for my $field (@BasicFields, 'creationdatestart_month','creationdatestart_day', @@ -1326,7 +1327,7 @@ sub parse_advanced_search { push @queries,"(copyright like \"$ENV{'form.copyright'}\")"; $pretty_search_string.=$font."copyright = ". &Apache::loncommon::copyrightdescription($ENV{'form.copyright'}). - "
\n"; + "
\n"; } # # Statistics @@ -2244,12 +2245,16 @@ $bodytag
END - # Check to see if $pretty_string has more than one carriage return. - # Assume \n s are following
s and truncate the value. - # (there is probably a better way)... - my @Lines = split /
/,$pretty_string; + # Remove leading and trailing
+ $pretty_string =~ s:^\s*
::i; + $pretty_string =~ s:(
)*\s*$::im; + my @Lines = split("
",$pretty_string); + # I keep getting blank items at the end of the list, hence the following: + while ($Lines[-1] =~ /^\s*$/ && @Lines) { + pop(@Lines); + } if (@Lines > 2) { - $pretty_string = join '
',(@Lines[0..2],'....
'); + $pretty_string = join '
',(@Lines[0..2],'....
'); } $r->print(&mt("Search: [_1]",$pretty_string)); $r->rflush(); @@ -3077,7 +3082,7 @@ sub detailed_citation_view { } elsif (exists($field->{'format'}) && $field->{'format'} ne ''){ $result.= &mt($field->{'translate'}, sprintf($field->{'format'}, - $values{$field->{'name'}})).'
'."\n"; + $values{$field->{'name'}}))."
\n"; } else { if ($field->{'special'} eq 'url link') { $result.=