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

matthew lon-capa-cvs@mail.lon-capa.org
Wed, 14 Apr 2004 18:30:36 -0000


matthew		Wed Apr 14 14:30:36 2004 EDT

  Modified files:              
    /loncom/interface	lonmeta.pm 
  Log:
  Fixed compilation bug in &print_dynamic_metadata.
  Removed metadtaa_col_to_hash and BEGIN block as this functionality
  is now in lonmetadata.pm.
  
  
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.67 loncom/interface/lonmeta.pm:1.68
--- loncom/interface/lonmeta.pm:1.67	Wed Apr 14 12:14:29 2004
+++ loncom/interface/lonmeta.pm	Wed Apr 14 14:30:36 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.67 2004/04/14 16:14:29 matthew Exp $
+# $Id: lonmeta.pm,v 1.68 2004/04/14 18:30:36 matthew Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -541,13 +541,16 @@
 </table>
 ENDHEAD
     if ($ENV{'user.adv'}) {
-        &print_dynamic_metadata($r,$uri);
+        &print_dynamic_metadata($r,$uri,\%content);
     }
     return;
 }
 
 sub print_dynamic_metadata {
-    my ($r,$uri) = @_;
+    my ($r,$uri,$content) = @_;
+    #
+    my %content = \$content;
+    my %lt=&fieldnames();
     #
     my $description = 'Dynamic Metadata (updated periodically)';
     $r->print('<h3>'.&mt($description).'</h3>'.
@@ -746,31 +749,6 @@
     $r->print('</form>');
     return;
 }
-
-##############################################################
-##############################################################
-# MySQL table columns
-
-my @columns;
-
-BEGIN {
-    # Get columns of MySQL metadata table
-    @columns=&Apache::lonmysql::col_order('metadata');
-}
-
-#
-# Turn MySQL row into hash
-#     This routine should be moved to lonmetadata
-#     a more generic place since it has nothing to do with metadata
-sub metadata_col_to_hash {
-    my @cols=@_;
-    my %hash=();
-    for (my $i=0; $i<=$#columns; $i++) {
-	$hash{$columns[$i]}=$cols[$i];
-    }
-    return %hash;
-}
-
 
 1;
 __END__