--- loncom/interface/lonsearchcat.pm 2004/06/03 20:32:33 1.229 +++ 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.229 2004/06/03 20:32:33 matthew Exp $ +# $Id: lonsearchcat.pm,v 1.230 2004/06/28 15:55:09 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -781,7 +781,7 @@ ENDHEADER $scrout.=''. &titlefield(&mt('Copyright/Distribution')).''. &Apache::lonmeta::selectbox('copyright', - '',, + $ENV{'form.copyright'}, \&Apache::loncommon::copyrightdescription, ( undef, &Apache::loncommon::copyrightids) @@ -789,7 +789,7 @@ ENDHEADER $scrout.=''. &titlefield(&mt('Language')).''. &Apache::lonmeta::selectbox('language', - 'notset',, + $ENV{'form.language'}, \&Apache::loncommon::languagedescription, ('any',&Apache::loncommon::languageids) ).''; @@ -1201,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', @@ -1327,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 @@ -2245,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(); @@ -3078,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.=