[LON-CAPA-cvs] cvs: loncom(version_2_9_X) /interface lonmsgdisplay.pm

raeburn raeburn@source.lon-capa.org
Mon, 25 Jan 2010 21:08:49 -0000


raeburn		Mon Jan 25 21:08:49 2010 EDT

  Modified files:              (Branch: version_2_9_X)
    /loncom/interface	lonmsgdisplay.pm 
  Log:
  - Backport 1.141.
  
  
Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.124.4.6 loncom/interface/lonmsgdisplay.pm:1.124.4.7
--- loncom/interface/lonmsgdisplay.pm:1.124.4.6	Mon Jan 25 20:56:40 2010
+++ loncom/interface/lonmsgdisplay.pm	Mon Jan 25 21:08:48 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.124.4.6 2010/01/25 20:56:40 raeburn Exp $
+# $Id: lonmsgdisplay.pm,v 1.124.4.7 2010/01/25 21:08:48 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -146,7 +146,7 @@
     );
     $actions{'select_form_order'} = ['view','rename','delete'];
 
-    my %statushash = &get_msgstatus_types();
+    my %statushash = &Apache::lonlocal::texthash(&get_msgstatus_types());
 
     $statushash{'select_form_order'} = ['','new','read','replied','forwarded'];
 
@@ -219,8 +219,7 @@
 </script>|;
     my %show = ('select_form_order' => [10,20,50,100,200],
 		map {$_=>$_} (10,20,50,100,200));
-		
-		   
+
     $output .= '
 <form method="post" action="/adm/email" name="folderlist">
 <table border="0" cellspacing="2" cellpadding="2">
@@ -273,12 +272,13 @@
 }
 
 sub get_msgstatus_types {
-    my %statushash = &Apache::lonlocal::texthash(
-                                '' => 'Any',
-                                new => 'Unread',
-                                read => 'Read',
-                                replied => 'Replied to',
-                                forwarded => 'Forwarded',
+    # Don't translate here!
+    my %statushash = (
+        ''          => 'Any',
+        'new'       => 'Unread',
+        'read'      => 'Read',
+        'replied'   => 'Replied to',
+        'forwarded' => 'Forwarded',
     );
     return %statushash;
 }
@@ -291,7 +291,7 @@
     my %statushash = &get_msgstatus_types();
     my $status;
     if ($msgstatus eq '') {
-        $status = &mt('All');
+        $status = 'All'; # Don't translate here!
     } else {
         $status = $statushash{$msgstatus};
     }
@@ -850,8 +850,11 @@
     }
     # Check to see if there were any messages.
     if ($result eq '') {
-        $result = "<h2>".&mt('You have no critical messages.')."</h2>".
-	    '<a href="/adm/roles">'.&mt('Select a course').'</a><br />'.
+        $result =
+            '<p class="LC_info">'.
+            &mt('You have no critical messages.').
+            '</p>'.
+            '<a href="/adm/roles">'.&mt('Select a course').'</a><br />'.
             '<a href="/adm/email">'.&mt('Communicate').'</a>';
     } else {
         $r->print($header);
@@ -1053,19 +1056,22 @@
     my $fsqs='&amp;folder='.$folder;
     my @temp=&sortedmessages(\%blocked,$startblock,$endblock,\$numblocked,$folder,$msgstatus);
     my $totalnumber=$#temp+1;
+
     if ($totalnumber < 1) {
+        $r->print('<p class="LC_info">');
         if ($msgstatus eq '') {
-	    $r->print('<h2>'.&mt('Empty Folder').'</h2>');
+            $r->print(&mt('There are no messages in this folder.'));
         } elsif ($msgstatus eq 'replied') {
-            $r->print('<h2>'.&mt('You have not replied to any messages in this folder.').'</h2>');
+            $r->print(&mt('You have not replied to any messages in this folder.'));
         } else { 
-            $r->print('<h2>'.&mt('There are no '.lc($statushash{$msgstatus}).' messages in this folder.').'</h2>');
+            $r->print(&mt('There are no '.lc($statushash{$msgstatus}).' messages in this folder.'));
         }
+        $r->print('</p>');
         if ($numblocked > 0) {
             $r->print(&blocked_in_folder($numblocked,$startblock,$endblock,
                                          \%setters));
         }
-	return;
+        return;
     }
     my $interdis = $env{'form.interdis'};
     my $number=int($totalnumber/$interdis);