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

bisitz bisitz@source.lon-capa.org
Tue, 09 Jun 2009 13:50:03 -0000


bisitz		Tue Jun  9 13:50:03 2009 EDT

  Modified files:              
    /loncom/interface	lonsource.pm 
  Log:
  - Non-obsolete warning message:
      - Localization: Added &mt call
      - Replaced hardcoded font color by appropriate warning style
  - Optimized &mt usage for error messages
  - Added error style to error message (no such file)
  
  
Index: loncom/interface/lonsource.pm
diff -u loncom/interface/lonsource.pm:1.22 loncom/interface/lonsource.pm:1.23
--- loncom/interface/lonsource.pm:1.22	Sat Apr  4 21:47:41 2009
+++ loncom/interface/lonsource.pm	Tue Jun  9 13:50:03 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
-# Souce Code handler
+# Source Code handler
 #
-# $Id: lonsource.pm,v 1.22 2009/04/04 21:47:41 bisitz Exp $
+# $Id: lonsource.pm,v 1.23 2009/06/09 13:50:03 bisitz Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -129,17 +129,22 @@
 sub delete_copy_file {
     my ($r, $author_name, $newpath, $filename, $path_to_new_file, $type) = @_;
     if($type eq '1') {
-        $r->print("<b>Cannot delete non-obsolete published file</b><br />Please
-              use the code view in previous window to use shared code<br /><br />");
-        $r->print('<input type="button" value="Close Window" name="close" onClick="window.close()" />');
+        $r->print('<p><span class="LC_warning">'
+                 .&mt('Cannot delete non-obsolete published file.')
+                 .'</span><br />'
+                 .&mt('Please use the code view in previous window to use shared code.')
+                 .'<br /><br />');
+        $r->print('<input type="button" value="Close Window" name="close"'
+                 .' onClick="window.close()" />'
+                 .'</p>');
     } else {
         if(-e $path_to_new_file) {
             unless(unlink($path_to_new_file)) {
-                $r->print('<font color="red">'.&mt('Error').': '.$!.'</font>');
+                $r->print('<p class="LC_error"">'.&mt('Error:').' '.$!.'</p>');
                 return 0;
             }
         } else {
-            $r->print('<p> '.&mt('No such file').'. </p></form>');
+            $r->print('<p class="LC_error">'.&mt('No such file').'</p></form>');
             return 0;
         }
         &copy_file($r, $author_name, $newpath, $filename, $path_to_new_file);
@@ -158,11 +163,11 @@
 
             else {
                 unless(mkdir($path, 02770)) {
-                    $r->print('<font color="red">'.&mt('Error').': '.$!.'</font>');
+                    $r->print('<p class="LC_error">'.&mt('Error:').' '.$!.'</p>');
                     return 0;
                 }
                 unless(chmod(02770, ($path))) {
-                    $r->print('<font color="red"> '.&mt('Error').': '.$!.'</font>');
+                    $r->print('<p class="LC_error"> '.&mt('Error:').' '.$!.'</p>');
                     return 0;
                 }
             }