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

matthew lon-capa-cvs@mail.lon-capa.org
Wed, 16 Mar 2005 22:52:04 -0000


matthew		Wed Mar 16 17:52:04 2005 EDT

  Modified files:              
    /loncom/interface	lonmeta.pm 
  Log:
  &fieldnames: Consolidated redundant definitions.  Added 'domain' to fields.
  
  
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.92 loncom/interface/lonmeta.pm:1.93
--- loncom/interface/lonmeta.pm:1.92	Thu Feb 17 03:29:43 2005
+++ loncom/interface/lonmeta.pm	Wed Mar 16 17:52:04 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.92 2005/02/17 08:29:43 albertel Exp $
+# $Id: lonmeta.pm,v 1.93 2005/03/16 22:52:04 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -237,10 +237,8 @@
 # The field names
 sub fieldnames {
     my $file_type=shift;
-    if ($file_type eq 'portfolio') {
-    return &Apache::lonlocal::texthash
-        (
-         'title' => 'Title',
+    my %fields = 
+        ('title' => 'Title',
          'author' =>'Author(s)',
          'authorspace' => 'Author Space',
          'modifyinguser' => 'Last Modifying User',
@@ -250,19 +248,10 @@
          'abstract' => 'Abstract',
          'lowestgradelevel' => 'Lowest Grade Level',
          'highestgradelevel' => 'Highest Grade Level');
-    } else {
-    return &Apache::lonlocal::texthash
-        (
-         'title' => 'Title',
-         'author' =>'Author(s)',
-         'authorspace' => 'Author Space',
-         'modifyinguser' => 'Last Modifying User',
-         'subject' => 'Subject',
-         'keywords' => 'Keyword(s)',
-         'notes' => 'Notes',
-         'abstract' => 'Abstract',
-         'lowestgradelevel' => 'Lowest Grade Level',
-         'highestgradelevel' => 'Highest Grade Level',
+    if (! defined($file_type) || $file_type ne 'portfolio') {
+        %fields = 
+        (%fields,
+         'domain' => 'Domain',
          'standards' => 'Standards',
          'mime' => 'MIME Type',
          'language' => 'Language',
@@ -295,7 +284,8 @@
          'disc'       => 'Degree of discrimination',
 	 'dependencies' => 'Resources used by this resource',
          );
-        }
+    }
+    return &Apache::lonlocal::texthash(%fields);
 }
 
 # Pretty printing of metadata field