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

bisitz lon-capa-cvs-allow@mail.lon-capa.org
Mon, 15 Sep 2008 15:34:11 -0000


bisitz		Mon Sep 15 11:34:11 2008 EDT

  Modified files:              
    /loncom/interface	londocs.pm 
  Log:
  - Bugfix: "not found" message now uses correct closing tag
  - Replaced hardcoded "ok" style with LON-CAPA standard CSS
  - Added another line break between each first level lines to get an output which could be better read
  - Optimized output for warnings and error counter
  
  
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.312 loncom/interface/londocs.pm:1.313
--- loncom/interface/londocs.pm:1.312	Thu Sep 11 10:47:21 2008
+++ loncom/interface/londocs.pm	Mon Sep 15 11:34:10 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.312 2008/09/11 14:47:21 bisitz Exp $
+# $Id: londocs.pm,v 1.313 2008/09/15 15:34:10 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1990,6 +1990,9 @@
     $r->rflush();
     if (($url) && ($url!~/^\/uploaded\//) && ($url!~/\*$/)) {
        $r->print("\n<br />");
+       if ($level==0) {
+           $r->print("<br />");
+       }
        for (my $i=0;$i<=$level*5;$i++) {
            $r->print('&nbsp;');
        }
@@ -1999,7 +2002,7 @@
 	  my $result=&Apache::lonnet::repcopy(
                               &Apache::lonnet::filelocation('',$url));
           if ($result eq 'ok') {
-             $r->print('<font color="green">'.&mt('ok').'</font>');
+             $r->print('<span class="LC_success">'.&mt('ok').'</span>');
              $r->rflush();
              &Apache::lonnet::countacc($url);
              $url=~/\.(\w+)$/;
@@ -2009,7 +2012,7 @@
                  for (my $i=0;$i<=$level*5;$i++) {
                      $r->print('&nbsp;');
                  }
-                 $r->print('- '.&mt('Rendering').': ');
+                 $r->print('- '.&mt('Rendering:').' ');
 		 my ($errorcount,$warningcount)=split(/:/,
 	       &Apache::lonnet::ssi_body($url,
 			       ('grade_target'=>'web',
@@ -2018,13 +2021,11 @@
                      ($warningcount)) {
 		     if ($errorcount) {
                         $r->print('<img src="/adm/lonMisc/bomb.gif" /><span class="LC_error">'.
-			  $errorcount.' '.
-				  &mt('error(s)').'</span> ');
+                          &mt('[quant,_1,error]',$errorcount).'</span>');
                      }
 		     if ($warningcount) {
                         $r->print('<span class="LC_warning">'.
-			  $warningcount.' '.
-				  &mt('warning(s)').'</span>');
+                          &mt('[quant,_1,warning]',$warningcount).'</span>');
                      }
                  } else {
                      $r->print('<span class="LC_success">'.&mt('ok').'</span>');
@@ -2042,15 +2043,15 @@
              $r->print('<span class="LC_error">'.&mt('connection down').'</span>');
           } elsif ($result eq 'not_found') {
 	      unless ($url=~/\$/) {
-		  $r->print('<span class="LC_error">'.&mt('not found').'</b></font>');
+		  $r->print('<span class="LC_error">'.&mt('not found').'</b></span>');
 	      } else {
 		  $r->print('<span class="LC_unknown">'.&mt('unable to verify variable URL').'</span>');
 	      }
           } else {
              $r->print('<span class="LC_error">'.&mt('access denied').'</span>');
           }
-      }
-   }
+       }
+    }
 }