--- loncom/interface/lonsearchcat.pm 2003/03/08 03:24:58 1.168 +++ loncom/interface/lonsearchcat.pm 2003/03/10 14:20:07 1.169 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.168 2003/03/08 03:24:58 www Exp $ +# $Id: lonsearchcat.pm,v 1.169 2003/03/10 14:20:07 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -142,9 +142,13 @@ my %persistent_db; my $hidden_fields; my $bodytag; +# +# For course search +# my %alreadyseen; my $hashtied; my %hash; +my $totalfound; ###################################################################### ###################################################################### @@ -418,6 +422,7 @@ sub course_search { } my $fulltext=$ENV{'form.crsfulltext'}; my @allwords=($search_string,@New_Words); + $totalfound=0; $r->print('LON-CAPA Course Search'. $bodytag.$pretty_search_string); $r->rflush(); @@ -425,13 +430,18 @@ sub course_search { $hashtied=0; undef %alreadyseen; %alreadyseen=(); + my $c=$r->connection; &tiehash(); foreach (keys %hash) { + if ($c->aborted()) { last; } if (($_=~/^src\_(.+)$/) && (!$alreadyseen{$hash{$_}})) { &checkonthis($r,$hash{$_},0,$hash{'title_'.$1},$fulltext,@allwords); } } &untiehash(); + unless ($totalfound) { + $r->print('

No resources found.

'); + } # =================================================== Done going through course $r->print(''); } @@ -482,9 +492,12 @@ sub checkonthis { $r->print(' '); } $r->print(''. - ($title?$title:$url).''); - $r->rflush(); + ($title?$title:$url).'
'); + $totalfound++; + } elsif ($fulltext) { + $r->print(' .'); } + $r->rflush(); # Check also the dependencies of this one my $dependencies= &Apache::lonnet::metadata($url,'dependencies');