--- loncom/interface/lonsearchcat.pm 2003/01/06 13:54:25 1.162 +++ loncom/interface/lonsearchcat.pm 2003/03/08 03:24:58 1.168 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.162 2003/01/06 13:54:25 www Exp $ +# $Id: lonsearchcat.pm,v 1.168 2003/03/08 03:24:58 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -74,12 +74,11 @@ package Apache::lonsearchcat; # ------------------------------------------------- modules used by this module use strict; -use Apache::Constants qw(:common); +use Apache::Constants qw(:common :http); use Apache::lonnet(); use Apache::File(); use CGI qw(:standard); use Text::Query; -use DBI; use GDBM_File; use Apache::loncommon(); use Apache::lonmysql(); @@ -143,6 +142,10 @@ my %persistent_db; my $hidden_fields; my $bodytag; +my %alreadyseen; +my $hashtied; +my %hash; + ###################################################################### ###################################################################### @@ -339,6 +342,8 @@ END &run_search($r,$query,$customquery,$customshow, $libraries,$pretty_string); } + } elsif ($ENV{'form.phase'} eq 'course_search') { + &course_search($r); } elsif(($ENV{'form.phase'} eq 'basic_search') || ($ENV{'form.phase'} eq 'adv_search')) { $ENV{'form.searchmode'} = 'basic'; @@ -397,6 +402,102 @@ END ###################################################################### ###################################################################### +sub course_search { + my $r=shift; + my $bodytag=&Apache::loncommon::bodytag('Course Search'); + my $pretty_search_string = ''.$ENV{'form.courseexp'}.''; + my $search_string = $ENV{'form.courseexp'}; + my @New_Words; + if ($ENV{'form.crsrelated'}) { + ($search_string,@New_Words) = &related_version($ENV{'form.courseexp'}); + if (@New_Words) { + $pretty_search_string .= " with related words: @New_Words."; + } else { + $pretty_search_string .= " with no related words."; + } + } + my $fulltext=$ENV{'form.crsfulltext'}; + my @allwords=($search_string,@New_Words); + $r->print('