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

raeburn raeburn@source.lon-capa.org
Sat, 13 Dec 2008 21:07:46 -0000


This is a MIME encoded message

--raeburn1229202466
Content-Type: text/plain

raeburn		Sat Dec 13 21:07:46 2008 EDT

  Modified files:              (Branch: version_2_8_X)
    /loncom/interface	lonmeta.pm 
  Log:
  - Backport 1.218.
  
  
--raeburn1229202466
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20081213210746.txt"

Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.212 loncom/interface/lonmeta.pm:1.212.2.1
--- loncom/interface/lonmeta.pm:1.212	Thu Mar  6 20:20:18 2008
+++ loncom/interface/lonmeta.pm	Sat Dec 13 21:07:46 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.212 2008/03/06 20:20:18 www Exp $
+# $Id: lonmeta.pm,v 1.212.2.1 2008/12/13 21:07:46 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -182,7 +182,7 @@
     my $val=int($value*10.+0.5)-10;
     my $output='<table border="0" cellpadding="0" cellspacing="0"><tr>';
     if ($val>=20) {
-	$output.='<td width="20" bgcolor="#555555">&nbsp&nbsp;</td>';
+	$output.='<td width="20" bgcolor="#555555">'.('&nbsp;' x2).'</td>';
     } else {
         $output.='<td width="'.($val).'" bgcolor="#555555">&nbsp;</td>'.
                  '<td width="'.(20-$val).'" bgcolor="#FF3333">&nbsp;</td>';
@@ -192,7 +192,7 @@
 	$output.='<td width="'.($val-20).'" bgcolor="#33FF33">&nbsp;</td>'.
                  '<td width="'.(40-$val).'" bgcolor="#555555">&nbsp;</td>';
     } else {
-        $output.='<td width="20" bgcolor="#555555">&nbsp&nbsp;</td>';
+        $output.='<td width="20" bgcolor="#555555">'.('&nbsp;' x2).'</td>';
     }
     $output.='<td> ('.sprintf("%5.2f",$value).') </td></tr></table>';
     return $output;
@@ -906,9 +906,9 @@
     my $obsolete=$content{'obsolete'};
     my $obsoletewarning='';
     if (($obsolete) && ($env{'user.adv'})) {
-        $obsoletewarning='<p><font color="red">'.
+        $obsoletewarning='<p><span class="LC_warning">'.
             &mt('This resource has been marked obsolete by the author(s)').
-            '</font></p>';
+            '</span></p>';
     }
     #
     my %lt=&fieldnames();
@@ -945,23 +945,22 @@
 		   'obsoletereplacement');
     }
     foreach my $field (@fields) {
-        $table.='<tr><td bgcolor="#AAAAAA">'.$lt{$field}.
-            '</td><td bgcolor="#CCCCCC">'.
-            &prettyprint($field,$content{$field}).'</td></tr>';
+        $table.=&Apache::lonhtmlcommon::row_title($lt{$field})
+                .&prettyprint($field,$content{$field}).
+                .&Apache::lonhtmlcommon::row_closure();
         delete($content{$field});
     }
     #
-    $r->print(<<ENDHEAD);
-<h2>$title</h2>
-<p>
-$disuri<br />
-$obsoletewarning
-$versiondisplay
-</p>
-<table cellspacing="2" border="0">
-$table
-</table>
-ENDHEAD
+    $r->print("<h2>$title</h2>"
+              .'<p>'
+              .$disuri.'<br />'
+              .$obsoletewarning
+              .$versiondisplay
+              .'</p>'
+              .&Apache::lonhtmlcommon::start_pick_box()
+              .$table
+              .&Apache::lonhtmlcommon::end_pick_box()
+    );
     if (!$uploaded && $env{'user.adv'}) {
         &print_dynamic_metadata($r,$uri,\%content);
     }
@@ -988,17 +987,18 @@
         exists($dynmeta{'goto'}) ||
         exists($dynmeta{'course'})) {
         $r->print('<h4>'.&mt('Access and Usage Statistics').'</h4>'.
-                  '<table cellspacing="2" border="0">');
+                  &Apache::lonhtmlcommon::start_pick_box());
         foreach ('count',
                  'sequsage','sequsage_list',
                  'comefrom','comefrom_list',
                  'goto','goto_list',
                  'course','course_list') {
-            $r->print('<tr><td bgcolor="#AAAAAA">'.$lt{$_}.'</td>'.
-                      '<td bgcolor="#CCCCCC">'.
-                      &prettyprint($_,$dynmeta{$_})."</td></tr>\n");
+            $r->print(&Apache::lonhtmlcommon::row_title($lt{$_})
+                      .&prettyprint($_,$dynmeta{$_})
+                      .&Apache::lonhtmlcommon::row_closure()
+            );
         }
-        $r->print('</table>');
+        $r->print(&Apache::lonhtmlcommon::end_pick_box());
     } else {
         $r->print('<h4>'.&mt('No Access or Usages Statistics are available for this resource.').'</h4>');
     }
@@ -1013,18 +1013,18 @@
             $r->print('<h4>'.
                       &mt('Overall Assessment Statistical Data').
                       '</h4>'.
-                      '<table cellspacing="2" border="0">');
-            $r->print('<tr><td bgcolor="#AAAAAA">'.$lt{'stdno'}.'</td>'.
-                      '<td bgcolor="#CCCCCC">'.
-                      &prettyprint('stdno',$dynmeta{'stdno'}).
-                      '</td>'."</tr>\n");
+                      &Apache::lonhtmlcommon::start_pick_box());
+            $r->print(&Apache::lonhtmlcommon::row_title($lt{'stdno'})
+                      .&prettyprint('stdno',$dynmeta{'stdno'})
+                      .&Apache::lonhtmlcommon::row_closure()
+            );
             foreach ('avetries','difficulty','disc') {
-                $r->print('<tr><td bgcolor="#AAAAAA">'.$lt{$_}.'</td>'.
-                          '<td bgcolor="#CCCCCC">'.
-                          &prettyprint($_,sprintf('%5.2f',$dynmeta{$_})).
-                          '</td>'."</tr>\n");
+                $r->print(&Apache::lonhtmlcommon::row_title($lt{$_})
+                          .&prettyprint($_,sprintf('%5.2f',$dynmeta{$_})).
+                          .&Apache::lonhtmlcommon::row_closure()
+                );
             }
-            $r->print('</table>');    
+            $r->print(&Apache::lonhtmlcommon::end_pick_box());    
         }
         if (exists($dynmeta{'stats'})) {
             #
@@ -1032,16 +1032,16 @@
             $r->print('<h4>'.
                       &mt('Recent Detailed Assessment Statistical Data').
                       '</h4>');
-            my $table = '<table cellspacing="2" border="0">'.
-                '<tr>'.
-                '<th>'.&mt('Course').'</th>'.
-                '<th>'.&mt('Section(s)').'</th>'.
-                '<th>'.&mt('Num Student').'s</th>'.
-                '<th>'.&mt('Mean Tries').'</th>'.
-                '<th>'.&mt('Degree of Difficulty').'</th>'.
-                '<th>'.&mt('Degree of Discrimination').'</th>'.
-                '<th>'.&mt('Time of computation').'</th>'.
-                '</tr>'.$/;
+            my $table=&Apache::loncommon::start_data_table()
+                      .&Apache::loncommon::start_data_table_header_row()
+                      .'<th>'.&mt('Course').'</th>'.
+                      .'<th>'.&mt('Section(s)').'</th>'.
+                      .'<th>'.&mt('Num Student').'s</th>'.
+                      .'<th>'.&mt('Mean Tries').'</th>'.
+                      .'<th>'.&mt('Degree of Difficulty').'</th>'.
+                      .'<th>'.&mt('Degree of Discrimination').'</th>'.
+                      .'<th>'.&mt('Time of computation').'</th>'.
+                      .&Apache::loncommon::end_data_table_header_row().$/;
             foreach my $identifier (sort(keys(%{$dynmeta{'stats'}}))) {
                 my $data = $dynmeta{'stats'}->{$identifier};
                 my $course = $data->{'course'};
@@ -1052,9 +1052,9 @@
                     &Apache::lonnet::logthis('lookup for '.$course.' failed');
                     next;
                 }
-                $table .= '<tr>';
+                $table .= &Apache::loncommon::start_data_table_row();
                 $table .= 
-                    '<td><nobr>'.$courseinfo{'description'}.'</nobr></td>';
+                    '<td><span class="LC_nobreak">'.$courseinfo{'description'}.'</span></td>';
                 $table .= 
                     '<td align="right">'.$data->{'sections'}.'</td>';
                 $table .=
@@ -1069,13 +1069,12 @@
                     $table .= '</td>';
                 }
                 $table .=
-                    '<td><nobr>'.
+                    '<td><span class="LC_nobreak">'.
                     &Apache::lonlocal::locallocaltime($data->{'timestamp'}).
-                    '</nobr></td>';
-                $table .=
-                    '</tr>'.$/;
+                    '</span></td>';
+                $table .= &Apache::loncommon::end_data_table_row().$/;
             }
-            $table .= '</table>'.$/;
+            $table .= &Apache::loncommon::end_data_table().$/;
             $r->print($table);
         } else {
             $r->print(&mt('No new dynamic data found.'));
@@ -1094,13 +1093,14 @@
         exists($dynmeta{'correct'}) || 
         exists($dynmeta{'technical'})){ 
         $r->print('<h4>'.&mt('Evaluation Data').'</h4>'.
-                  '<table cellspacing="2" border="0">');
+                  &Apache::lonhtmlcommon::start_pick_box());
         foreach ('clear','depth','helpful','correct','technical') {
-            $r->print('<tr><td bgcolor="#AAAAAA">'.$lt{$_}.'</td>'.
-                      '<td bgcolor="#CCCCCC">'.
-                      &prettyprint($_,$dynmeta{$_})."</td></tr>\n");
+            $r->print(&Apache::lonhtmlcommon::row_title($lt{$_})
+                      .&prettyprint($_,$dynmeta{$_})
+                      .&Apache::lonhtmlcommon::row_closure()
+            );
         }
-        $r->print('</table>');
+        $r->print(&Apache::lonhtmlcommon::end_pick_box());
     } else {
         $r->print('<h4>'.&mt('No Evaluation Data is available for this resource.').'</h4>');
     }
@@ -1128,7 +1128,8 @@
     # All other stuff
     $r->print('<h3>'.
               &mt('Additional Metadata (non-standard, parameters, exports)').
-              '</h3><table border="0" cellspacing="1">');
+              '</h3>');
+    $r->print(&Apache::lonhtmlcommon::start_pick_box());
     foreach (sort(keys(%content))) {
         my $name=$_;
         if ($name!~/\.display$/) {
@@ -1146,14 +1147,15 @@
                                                   $name.'.'.$_).'; ';
                 }
             }
-            $r->print('<tr><td bgcolor="#bbccbb"><font size="-1" color="#556655">'.$display.'</font></td><td bgcolor="#ccddcc"><font size="-1" color="#556655">'.$content{$name});
+            $r->print(&Apache::lonhtmlcommon::row_title($display)
+                      .$content{$name});
             if ($otherinfo) {
                 $r->print(' ('.$otherinfo.')');
             }
-            $r->print("</font></td></tr>\n");
+            $r->print(&Apache::lonhtmlcommon::row_closure());
         }
     }
-    $r->print("</table>");
+    $r->print(&Apache::lonhtmlcommon::end_pick_box());
     return;
 }
 

--raeburn1229202466--