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

banghart lon-capa-cvs@mail.lon-capa.org
Mon, 20 Nov 2006 20:58:31 -0000


banghart		Mon Nov 20 15:58:31 2006 EDT

  Modified files:              
    /loncom/interface	lonmeta.pm 
  Log:
  	Use previously invented wheel. (data_table classes)
  
  
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.188 loncom/interface/lonmeta.pm:1.189
--- loncom/interface/lonmeta.pm:1.188	Mon Nov 20 14:39:22 2006
+++ loncom/interface/lonmeta.pm	Mon Nov 20 15:58:30 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.188 2006/11/20 19:39:22 banghart Exp $
+# $Id: lonmeta.pm,v 1.189 2006/11/20 20:58:30 banghart Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1273,11 +1273,9 @@
                 $lt{$field_name} = $$added_metadata_fields{$field_name};
             }
         }
-        $output.='<table>';
+        $output .= &Apache::loncommon::start_data_table();
         my $row_alt = 1;
         foreach my $field_name (@fields) {
-            # $row_alt = ($row_alt) ? 0 : 1;
-            my $row_class = ($row_alt) ? ' class="LC_metadata_light" ' : ' class="LC_metadata_dark" ';
             if (defined($env{'form.new_'.$field_name})) {
                 $Apache::lonpublisher::metadatafields{$field_name}=
                     join(',',&Apache::loncommon::get_env_multiple('form.new_'.$field_name));
@@ -1289,23 +1287,25 @@
                     ($field_name eq 'courserestricted'))&&
                     (!($env{$Apache::lonpublisher::metadatafields{'courserestricted'}.'.metadata.'.$field_name.'.options'} =~ m/deleted/))){
                     
-                    $output.=("\n".'<tr '.$row_class.'><td><span class="LC_metadata">'.$lt{$field_name}.':</span></td><td> '.
+                    $output .= "\n".&Apache::loncommon::start_data_table_row();
+                    $output .= ('<td><span class="LC_metadata">'.$lt{$field_name}.':</span></td><td> '.
                               &prettyinput($field_name,
 				   $Apache::lonpublisher::metadatafields{$field_name},
 				                    'new_'.$field_name,'defaultmeta',
 				                    undef,undef,undef,undef,
-				                    $Apache::lonpublisher::metadatafields{'courserestricted'}).'</td></tr>'."\n");
+				                    $Apache::lonpublisher::metadatafields{'courserestricted'}).'</td>');
+                    $output .= &Apache::loncommon::end_data_table_row();
                  }
             } else {
 
-                    $output.=('<tr'.$row_class.'><td><span class="LC_metadata">'.$lt{$field_name}.':</span></td><td> '.
+                    $output.=(&Apache::loncommon::start_data_table_row().'<td><span class="LC_metadata">'.$lt{$field_name}.':</span></td><td> '.
 			      &prettyinput($field_name,
 					   $Apache::lonpublisher::metadatafields{$field_name},
-					   'new_'.$field_name,'defaultmeta').'</td></tr>');
+					   'new_'.$field_name,'defaultmeta').'</td>'.&Apache::loncommon::end_data_table_row());
                
             }
         }
-        $output.='</table>';
+        $output .= &Apache::loncommon::end_data_table();
 	if ($env{'form.store'}) {
 	    my $mfh;
 	    my $formname='store';