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

matthew lon-capa-cvs@mail.lon-capa.org
Mon, 24 Jun 2002 20:17:55 -0000


matthew		Mon Jun 24 16:17:55 2002 EDT

  Modified files:              
    /loncom/interface	loncommon.pm 
  Log:
  filecategories:
      Changed %fc to %category_extensions.
      %category_extensions associates file extensions with categories.
  POD:
      Minor cleanups to documentation I inflicted in the first place.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.38 loncom/interface/loncommon.pm:1.39
--- loncom/interface/loncommon.pm:1.38	Mon Jun 24 15:06:05 2002
+++ loncom/interface/loncommon.pm	Mon Jun 24 16:17:55 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.38 2002/06/24 19:06:05 albertel Exp $
+# $Id: loncommon.pm,v 1.39 2002/06/24 20:17:55 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -85,7 +85,7 @@
 my %language;
 my %cprtag;
 my %fe; my %fd;
-my %fc;
+my %category_extensions;
 
 # -------------------------------------------------------------- Thesaurus data
 my @therelated;
@@ -146,8 +146,8 @@
 	    while (<$fh>) {
 		next if /^\#/;
 		chomp;
-		my ($key,$val)=(split(/\s+/,$_,2));
-		push @{$fc{$key}},$val;
+		my ($extension,$category)=(split(/\s+/,$_,2));
+		push @{$category_extensions{lc($category)}},$extension;
 	    }
 	}
     }
@@ -215,14 +215,16 @@
 
 =item $hashref, a reference to a hash containing the data for the menus.
 
+=back 
+
 Below is an example of such a hash.  Only the 'text', 'default', and 
 'select2' keys must appear as stated.  keys(%menu) are the possible 
 values for the first select menu.  The text that coincides with the 
-first menu values is given in $menu{$choice1}->{'text'}.  The values 
+first menu value is given in $menu{$choice1}->{'text'}.  The values 
 and text for the second menu are given in the hash pointed to by 
 $menu{$choice1}->{'select2'}.  
 
- my %menu = ( A1 => { text =>"Choice A1" ,
+my %menu = ( A1 => { text =>"Choice A1" ,
                       default => "B3",
                       select2 => { 
                           B1 => "Choice B1",
@@ -741,12 +743,12 @@
 
 # ------------------------------------------------------------- File Categories
 sub filecategories {
-    return sort(keys(%fc));
+    return sort(keys(%category_extensions));
 }
 
 # -------------------------------------- File Types within a specified category
 sub filecategorytypes {
-    return @{$fc{lc(shift(@_))}};
+    return @{$category_extensions{lc($_[0])}};
 }
 
 # ------------------------------------------------------------------ File Types
@@ -929,8 +931,6 @@
 }
 
 =pod
-
-=back
 
 =head2 CSV Upload/Handling functions