[LON-CAPA-cvs] cvs: loncom /interface lonsearchcat.pm

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 24 Jun 2002 15:26:29 -0000


matthew		Mon Jun 24 11:26:29 2002 EDT

  Modified files:              
    /loncom/interface	lonsearchcat.pm 
  Log:
  Removed global variables:
     %hostdomains
     %hostips
     %hitcount
     $yourself
  Removed BEGIN block as all it did was initalize the globals above.
  
  
Index: loncom/interface/lonsearchcat.pm
diff -u loncom/interface/lonsearchcat.pm:1.126 loncom/interface/lonsearchcat.pm:1.127
--- loncom/interface/lonsearchcat.pm:1.126	Mon Jun 24 11:09:52 2002
+++ loncom/interface/lonsearchcat.pm	Mon Jun 24 11:26:28 2002
@@ -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.127 2002/06/24 15:26:28 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -101,18 +101,6 @@
 
 =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 @@
 ######################################################################
 ######################################################################
 
-# -- 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
 
 ######################################################################
 ######################################################################
@@ -1143,10 +1098,10 @@
                             return OK;
                         }
                         @results=<$fh> if $fh;
-                        $hitcount{$rkey}=@results+0;
+                        my $hits =@results;
                         &popwin_js($r,'popwin.hc["'.$rkey.'"]='.
-                                   $hitcount{$rkey}.';');
-                        $hitcountsum+=$hitcount{$rkey};
+                                   $hits.';');
+                        $hitcountsum+=$hits;
                         &popwin_js($r,'popwin.document.forms.popremain.'.
                                    'numhits.value='.$hitcountsum.';');
                     } else {
@@ -1547,13 +1502,14 @@
 	    $hcinit.="hc[\"$sk\"]=\"not yet connected...\";";
 	}
 	$grid.=" hitcount=".$hc;
-	$grid.=" domain=".$hostdomains{$sk};
-	$grid.=" IP=".$hostips{$sk};
+	$grid.=" domain=".$Apache::lonnet::hostdom{$sk};
+	$grid.=" IP=".$Apache::lonnet::hostip{$sk};
 	# '+"'"+'">'+
 	$grid.="'+\"'\"+')\">'+";
 	$grid.="\n";
-	$grid.="'<img border=\"0\" name=\"img_".$hostdomains{$sk}.'_'.$sk."\"".
-	    " src=\"/adm/lonIcons/srvnull.gif\" alt=\"".$sk."\" /></a>'+\n";
+	$grid.="'<img border=\"0\" name=\"img_".$Apache::lonnet::hostdom{$sk}.
+            '_'.$sk."\" src=\"/adm/lonIcons/srvnull.gif\" alt=\"".$sk.
+                "\" /></a>'+\n";
 	$grid.="'<br />'+\n" unless $sn%10;
         $sn++;
     }
@@ -1943,8 +1899,8 @@
 ######################################################################
 sub popwin_imgupdate {
     my ($r,$server,$icon) = @_;
-    &popwin_js($r,'popwin.document.img_'.$hostdomains{$server}.'_'.$server.'.'.
-	       'src="/adm/lonIcons/'.$icon.'";');
+    &popwin_js($r,'popwin.document.img_'.$Apache::lonnet::hostdom{$server}.
+               '_'.$server.'.'.'src="/adm/lonIcons/'.$icon.'";');
 }    
 
 1;