[LON-CAPA-cvs] cvs: loncom /interface lonsearchcat.pm
matthew
lon-capa-cvs@mail.lon-capa.org
Mon, 28 Jun 2004 15:55:09 -0000
matthew Mon Jun 28 11:55:09 2004 EDT
Modified files:
/loncom/interface lonsearchcat.pm
Log:
Copyright and language searches now remember their values.
Was using \ instead of / in some <br /> tags.
Cleaned up search description output.
Index: loncom/interface/lonsearchcat.pm
diff -u loncom/interface/lonsearchcat.pm:1.229 loncom/interface/lonsearchcat.pm:1.230
--- loncom/interface/lonsearchcat.pm:1.229 Thu Jun 3 16:32:33 2004
+++ loncom/interface/lonsearchcat.pm Mon Jun 28 11:55:09 2004
@@ -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 @@
$scrout.='<tr><td align="right" valign="top">'.
&titlefield(&mt('Copyright/Distribution')).'</td><td colspan="2">'.
&Apache::lonmeta::selectbox('copyright',
- '',,
+ $ENV{'form.copyright'},
\&Apache::loncommon::copyrightdescription,
( undef,
&Apache::loncommon::copyrightids)
@@ -789,7 +789,7 @@
$scrout.='<tr><td align="right" valign="top">'.
&titlefield(&mt('Language')).'</td><td colspan="2">'.
&Apache::lonmeta::selectbox('language',
- 'notset',,
+ $ENV{'form.language'},
\&Apache::loncommon::languagedescription,
('any',&Apache::loncommon::languageids)
).'</td></tr>';
@@ -1201,7 +1201,7 @@
my @StatsFields = &statfields();
my @EvalFields = &evalfields();
my $fillflag=0;
- my $pretty_search_string = "<br />\n";
+ my $pretty_search_string = "";
# Clean up fields for safety
for my $field (@BasicFields,
'creationdatestart_month','creationdatestart_day',
@@ -1327,7 +1327,7 @@
push @queries,"(copyright like \"$ENV{'form.copyright'}\")";
$pretty_search_string.=$font."copyright</font> = ".
&Apache::loncommon::copyrightdescription($ENV{'form.copyright'}).
- "<br \>\n";
+ "<br />\n";
}
#
# Statistics
@@ -2245,12 +2245,16 @@
<form name="statusform" action="" method="post">
<input type="hidden" name="Queue" value="" />
END
- # Check to see if $pretty_string has more than one carriage return.
- # Assume \n s are following <br /> s and truncate the value.
- # (there is probably a better way)...
- my @Lines = split /<br \/>/,$pretty_string;
+ # Remove leading and trailing <br />
+ $pretty_string =~ s:^\s*<br />::i;
+ $pretty_string =~ s:(<br />)*\s*$::im;
+ my @Lines = split("<br />",$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 '<br \>',(@Lines[0..2],'....<br />');
+ $pretty_string = join '<br />',(@Lines[0..2],'....<br />');
}
$r->print(&mt("Search: [_1]",$pretty_string));
$r->rflush();
@@ -3078,7 +3082,7 @@
} elsif (exists($field->{'format'}) && $field->{'format'} ne ''){
$result.= &mt($field->{'translate'},
sprintf($field->{'format'},
- $values{$field->{'name'}})).'<br />'."\n";
+ $values{$field->{'name'}}))."<br />\n";
} else {
if ($field->{'special'} eq 'url link') {
$result.=