version 1.168, 2003/03/08 03:24:58
|
version 1.169, 2003/03/10 14:20:07
|
Line 142 my %persistent_db;
|
Line 142 my %persistent_db;
|
my $hidden_fields; |
my $hidden_fields; |
my $bodytag; |
my $bodytag; |
|
|
|
# |
|
# For course search |
|
# |
my %alreadyseen; |
my %alreadyseen; |
my $hashtied; |
my $hashtied; |
my %hash; |
my %hash; |
|
my $totalfound; |
|
|
###################################################################### |
###################################################################### |
###################################################################### |
###################################################################### |
Line 418 sub course_search {
|
Line 422 sub course_search {
|
} |
} |
my $fulltext=$ENV{'form.crsfulltext'}; |
my $fulltext=$ENV{'form.crsfulltext'}; |
my @allwords=($search_string,@New_Words); |
my @allwords=($search_string,@New_Words); |
|
$totalfound=0; |
$r->print('<html><head><title>LON-CAPA Course Search</title></head>'. |
$r->print('<html><head><title>LON-CAPA Course Search</title></head>'. |
$bodytag.$pretty_search_string); |
$bodytag.$pretty_search_string); |
$r->rflush(); |
$r->rflush(); |
Line 425 sub course_search {
|
Line 430 sub course_search {
|
$hashtied=0; |
$hashtied=0; |
undef %alreadyseen; |
undef %alreadyseen; |
%alreadyseen=(); |
%alreadyseen=(); |
|
my $c=$r->connection; |
&tiehash(); |
&tiehash(); |
foreach (keys %hash) { |
foreach (keys %hash) { |
|
if ($c->aborted()) { last; } |
if (($_=~/^src\_(.+)$/) && (!$alreadyseen{$hash{$_}})) { |
if (($_=~/^src\_(.+)$/) && (!$alreadyseen{$hash{$_}})) { |
&checkonthis($r,$hash{$_},0,$hash{'title_'.$1},$fulltext,@allwords); |
&checkonthis($r,$hash{$_},0,$hash{'title_'.$1},$fulltext,@allwords); |
} |
} |
} |
} |
&untiehash(); |
&untiehash(); |
|
unless ($totalfound) { |
|
$r->print('<p>No resources found.</p>'); |
|
} |
# =================================================== Done going through course |
# =================================================== Done going through course |
$r->print('</body></html>'); |
$r->print('</body></html>'); |
} |
} |
Line 482 sub checkonthis {
|
Line 492 sub checkonthis {
|
$r->print(' '); |
$r->print(' '); |
} |
} |
$r->print('<a href="'.$url.'" target="cat">'. |
$r->print('<a href="'.$url.'" target="cat">'. |
($title?$title:$url).'</a>'); |
($title?$title:$url).'</a><br />'); |
$r->rflush(); |
$totalfound++; |
|
} elsif ($fulltext) { |
|
$r->print(' .'); |
} |
} |
|
$r->rflush(); |
# Check also the dependencies of this one |
# Check also the dependencies of this one |
my $dependencies= |
my $dependencies= |
&Apache::lonnet::metadata($url,'dependencies'); |
&Apache::lonnet::metadata($url,'dependencies'); |