--- loncom/interface/lonsearchcat.pm 2002/06/24 15:09:52 1.126
+++ loncom/interface/lonsearchcat.pm 2002/06/25 15:08:59 1.129
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Search Catalog
#
-# $Id: lonsearchcat.pm,v 1.126 2002/06/24 15:09:52 matthew Exp $
+# $Id: lonsearchcat.pm,v 1.129 2002/06/25 15:08:59 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -67,14 +67,14 @@ search (on a server basis) is displayed
###############################################################################
###############################################################################
+###############################################################################
## ##
## ORGANIZATION OF THIS PERL MODULE ##
## ##
## 1. Modules used by this module ##
-## 2. Choices for different output views (detailed, summary, xml, etc) ##
-## 3. BEGIN block (to be run once after compilation) ##
-## 4. Handling routine called via Apache and mod_perl ##
-## 5. Other subroutines ##
+## 2. Variables used throughout the module ##
+## 3. handler subroutine called via Apache and mod_perl ##
+## 4. Other subroutines ##
## ##
###############################################################################
@@ -101,18 +101,6 @@ use Apache::loncommon();
=over 4
-=item %hostdomains
-
-matches host name to host domain
-
-=item %hostips
-
-matches host name to host ip
-
-=item %hitcount
-
-stores number of hits per host
-
=item $closebutton
button that closes the search window
@@ -137,46 +125,13 @@ used in &handler() and is also used in &
######################################################################
######################################################################
-# -- information holders
-my %hostdomains; # matches host name to host domain
-my %hostips; # matches host name to host ip
-my %hitcount; # stores number of hits per host
-
# -- dynamically rendered interface components
my $closebutton; # button that closes the search window
my $importbutton; # button to take the selected results and go to group sorting
# -- miscellaneous variables
-my $yourself; # allows for quickly limiting to oneself
my %hash; # database hash
-
-# ------------------------------------------ choices for different output views
-# Detailed Citation View ---> sub detailed_citation_view
-# Summary View ---> sub summary_view
-# Fielded Format ---> sub fielded_format_view
-# XML/SGML ---> sub xml_sgml_view
-
-#------------------------------------------------------------- global variables
-my $diropendb = "";
-my $domain = "";
-
-# ----------------------------------------------------------------------- BEGIN
-
-=pod
-
-=item BEGIN block
-
-Load %hostdomains and %hostips with data from lonnet.pm. Only library
-servers are considered.
-
-=cut
-
-BEGIN {
- foreach (keys (%Apache::lonnet::libserv)) {
- $hostdomains{$_}=$Apache::lonnet::hostdom{$_};
- $hostips{$_}=$Apache::lonnet::hostip{$_};
- }
-}
+my $diropendb = ""; # db file
######################################################################
######################################################################
@@ -318,7 +273,8 @@ sub basic_search_form{
$hidden
Basic Search
-Enter terms or phrases separated by AND, OR, or NOT then press SEARCH below.
+Enter terms or quoted phrases separated by AND, OR, or NOT
+then press SEARCH below.
@@ -367,6 +323,23 @@ Returns a scalar which holds html for th
sub advanced_search_form{
my ($closebutton,$hidden) = @_;
+ my $advanced_buttons = <<"END";
+
+
+
+$closebutton
+
+
+
+
+
+END
my $scrout=<<"ENDHEADER";
@@ -381,34 +354,44 @@ sub advanced_search_form{
-
Search Catalog
-
@@ -579,7 +546,46 @@ the day, month, and year.
=item &selectbox()
-Returns html selection form.
+Returns a scalar containing an html ';
}
######################################################################
@@ -727,7 +731,7 @@ sub advancedsearch {
my @queries;
# Evaluate logical expression AND/OR/NOT phrase fields.
foreach my $field ('title','author','subject','notes','abstract','url',
- 'keywords','version','owner') {
+ 'keywords','version','owner','mime') {
if ($ENV{'form.'.$field}) {
push @queries,&build_SQL_query($field,$ENV{'form.'.$field});
}
@@ -736,9 +740,9 @@ sub advancedsearch {
if ($ENV{'form.language'} and $ENV{'form.language'} ne 'any') {
push @queries,"(language like \"$ENV{'form.language'}\")";
}
- if ($ENV{'form.mime'} and $ENV{'form.mime'} ne 'any') {
- push @queries,"(mime like \"$ENV{'form.mime'}\")";
- }
+# if ($ENV{'form.mime'} and $ENV{'form.mime'} ne 'any') {
+# push @queries,"(mime like \"$ENV{'form.mime'}\")";
+# }
if ($ENV{'form.copyright'} and $ENV{'form.copyright'} ne 'any') {
push @queries,"(copyright like \"$ENV{'form.copyright'}\")";
}
@@ -1066,8 +1070,14 @@ sub output_results {