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

raeburn raeburn@source.lon-capa.org
Sat, 13 Dec 2008 23:09:35 -0000


raeburn		Sat Dec 13 23:09:35 2008 EDT

  Modified files:              (Branch: version_2_8_X)
    /loncom/interface	lonmeta.pm 
  Log:
  - Backport 1.222.
  
  
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.212.2.2 loncom/interface/lonmeta.pm:1.212.2.3
--- loncom/interface/lonmeta.pm:1.212.2.2	Sat Dec 13 22:17:15 2008
+++ loncom/interface/lonmeta.pm	Sat Dec 13 23:09:35 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.212.2.2 2008/12/13 22:17:15 raeburn Exp $
+# $Id: lonmeta.pm,v 1.212.2.3 2008/12/13 23:09:35 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -945,10 +945,14 @@
 		   'obsolete', 
 		   'obsoletereplacement');
     }
+    my $rownum = 0;
     foreach my $field (@fields) {
+        my $lastrow = '';
+        $rownum ++;
+        $lastrow = 1 if ($rownum == @fields);
         $table.=&Apache::lonhtmlcommon::row_title($lt{$field})
                 .&prettyprint($field,$content{$field}).
-                .&Apache::lonhtmlcommon::row_closure();
+                .&Apache::lonhtmlcommon::row_closure($lastrow);
         delete($content{$field});
     }
     #
@@ -989,14 +993,17 @@
         exists($dynmeta{'course'})) {
         $r->print('<h4>'.&mt('Access and Usage Statistics').'</h4>'.
                   &Apache::lonhtmlcommon::start_pick_box());
-        foreach my $item ('count',
-                          'sequsage','sequsage_list',
-                          'comefrom','comefrom_list',
-                          'goto','goto_list',
-                          'course','course_list') {
+        my @counts = ('count','sequsage','sequsage_list',
+                      'comefrom','comefrom_list','goto',
+                      'goto_list','course','course_list');
+        my $rownum = 0;
+        foreach my $item (@counts) {
+            my $lastrow = '';
+            $rownum ++;
+            $lastrow = 1 if ($rownum == @counts);
             $r->print(&Apache::lonhtmlcommon::row_title($lt{$item})
                       .&prettyprint($item,$dynmeta{$item})
-                      .&Apache::lonhtmlcommon::row_closure()
+                      .&Apache::lonhtmlcommon::row_closure($lastrow)
             );
         }
         $r->print(&Apache::lonhtmlcommon::end_pick_box());
@@ -1019,10 +1026,15 @@
                       .&prettyprint('stdno',$dynmeta{'stdno'})
                       .&Apache::lonhtmlcommon::row_closure()
             );
-            foreach my $item ('avetries','difficulty','disc') {
+            my @stats = ('avetries','difficulty','disc');
+            my $rownum = 0;
+            foreach my $item (@stats) {
+                my $lastrow = '';
+                $rownum ++;
+                $lastrow = 1 if ($rownum == @stats);
                 $r->print(&Apache::lonhtmlcommon::row_title($lt{$item})
                           .&prettyprint($item,sprintf('%5.2f',$dynmeta{$item})).
-                          .&Apache::lonhtmlcommon::row_closure()
+                          .&Apache::lonhtmlcommon::row_closure($lastrow)
                 );
             }
             $r->print(&Apache::lonhtmlcommon::end_pick_box());    
@@ -1095,10 +1107,15 @@
         exists($dynmeta{'technical'})){ 
         $r->print('<h4>'.&mt('Evaluation Data').'</h4>'.
                   &Apache::lonhtmlcommon::start_pick_box());
-        foreach my $item ('clear','depth','helpful','correct','technical') {
+        my @criteria = ('clear','depth','helpful','correct','technical');
+        my $rownum = 0;
+        foreach my $item (@criteria) {
+            my $lastrow = '';
+            $rownum ++;
+            $lastrow = 1 if ($rownum == @criteria);
             $r->print(&Apache::lonhtmlcommon::row_title($lt{$item})
                       .&prettyprint($item,$dynmeta{$item})
-                      .&Apache::lonhtmlcommon::row_closure()
+                      .&Apache::lonhtmlcommon::row_closure($lastrow)
             );
         }
         $r->print(&Apache::lonhtmlcommon::end_pick_box());
@@ -1131,8 +1148,19 @@
               &mt('Additional Metadata (non-standard, parameters, exports)').
               '</h3>');
     $r->print(&Apache::lonhtmlcommon::start_pick_box());
-    foreach my $name (sort(keys(%content))) {
-        if ($name!~/\.display$/) {
+    my @names;
+    foreach my $key (sort(keys(%content))) {
+        if ($key!~/\.display$/) {
+            push(@names,$key);
+        }
+    }
+    if (@names > 0) {
+        my $rownum = 0;
+        foreach my $name (@names) {
+            my $lastrow = '';
+            $rownum ++;
+            $lastrow = 1 if ($rownum == @names);
+
             my $display=&Apache::lonnet::metadata($uri,
                                                   $name.'.display');
             if (! $display) { 
@@ -1152,7 +1180,7 @@
             if ($otherinfo) {
                 $r->print(' ('.$otherinfo.')');
             }
-            $r->print(&Apache::lonhtmlcommon::row_closure());
+            $r->print(&Apache::lonhtmlcommon::row_closure($lastrow));
         }
     }
     $r->print(&Apache::lonhtmlcommon::end_pick_box());