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

wenzelju wenzelju@source.lon-capa.org
Thu, 21 Jan 2010 13:29:41 -0000


This is a MIME encoded message

--wenzelju1264080581
Content-Type: text/plain

wenzelju		Thu Jan 21 13:29:41 2010 EDT

  Modified files:              
    /loncom/interface	lonmsgdisplay.pm 
  Log:
  Added confirm-success style and boxes where missing.
  
  
--wenzelju1264080581
Content-Type: text/plain
Content-Disposition: attachment; filename="wenzelju-20100121132941.txt"

Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.142 loncom/interface/lonmsgdisplay.pm:1.143
--- loncom/interface/lonmsgdisplay.pm:1.142	Thu Jan 14 17:20:44 2010
+++ loncom/interface/lonmsgdisplay.pm	Thu Jan 21 13:29:41 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.142 2010/01/14 17:20:44 bisitz Exp $
+# $Id: lonmsgdisplay.pm,v 1.143 2010/01/21 13:29:41 wenzelju Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3272,10 +3272,11 @@
                        '','','','',$recipid);
             }
         }
-        if (!$env{'form.multiforward'}) { 
+        if (!$env{'form.multiforward'}) {
             if ($sendstatus=~/^(\s*(?:ok|con_delayed)\s*)*$/) {
-	        $r->print('<br /><span class="LC_success">'.&mt('Completed.').
-                          '</span>');
+                my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Completed.'));
+                $message = &Apache::loncommon::confirmwrapper($message);
+                $r->print($message);
 	        if ($env{'form.displayedcrit'}) {
 	            &discrit($r);
                 }
@@ -3285,8 +3286,10 @@
 	            &Apache::loncommunicate::menu($r);
 	        }
             } else {
-	        $r->print('<p>'.&Apache::lonhtmlcommon::confirm_success(&mt('Could not deliver message'),1).'<br /> '.
-		          &mt('Please use the browser "Back" button and correct the recipient addresses ([_1]).',$sendstatus).'</p>');
+                my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Could not deliver message'),1);
+                $message .= '<br/>'.&mt('Please use the browser "Back" button and correct the recipient addresses ([_1]).',$sendstatus);
+                $message = &Apache::loncommon::confirmwrapper($message);
+                $r->print($message);
             }
         }
     }
@@ -3405,9 +3408,10 @@
 	my ($result,$msg) = 
 	    &statuschange($env{'form.markdel'},'deleted',$folder);
 	if (!$result) {
-	    $r->print('<p class="LC_error">'.
-		      &mt('Failed to delete the message.').'</p>'.
-		      '<p class="LC_error">'.$msg."</p>\n");
+            my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Failed to delete the message.'),1);
+            $message .= '<p class="LC_error">'.$msg.'</p>';
+            $message = &Apache::loncommon::confirmwrapper($message);
+            $r->print($message);
 	}
 	&Apache::loncommunicate::menu($r);
 	&disall($r,($folder?$folder:$dismode),$msgstatus);
@@ -3429,7 +3433,10 @@
             $total ++;
         }
         &printheader($r,'','Marked Messages Read');
-        $r->print(&mt('Marked [quant,_1,message] read',$total).'<p>');
+        my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Marked [quant,_1,message] read',$total));
+        $message = &Apache::loncommon::confirmwrapper($message);
+        $r->print($message);
+      # $r->print('<p>');
         &Apache::loncommunicate::menu($r);
         &disall($r,($folder?$folder:$dismode),$msgstatus);
     } elsif ($env{'form.markedaction'} eq 'markedunread') {
@@ -3440,7 +3447,10 @@
             $total ++;
         }
         &printheader($r,'','Marked Messages Unread');
-        $r->print(&mt('Marked [quant,_1,message] unread',$total).'<p>');
+        my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Marked [quant,_1,message] unread',$total));
+        $message = &Apache::loncommon::confirmwrapper($message);
+        $r->print($message);
+      # $r->print('<p>');
         &Apache::loncommunicate::menu($r);
         &disall($r,($folder?$folder:$dismode),$msgstatus);
     } elsif ($env{'form.markedaction'} eq 'markedmove') {
@@ -3463,18 +3473,17 @@
 		    push(@failed_msg,$msg);
 	        }
 	    }
-	    if ($failed) {
-                $r->print('<p class="LC_error">'
-                         .&mt('Failed to move [quant,_1,message]',$failed)
-                         .'</p>');
-	        $r->print('<p class="LC_error">'.
-	   	          join("</p>\n<p class=\"LC_error\">",@failed_msg).
-		          "</p>\n");
-	    }
-            $r->print('<p class="LC_success">'
-                     .&mt('Moved [quant,_1,message]',$total)
-                     .'</p>'
-                     .'<p>');
+            my $message = '';
+            if ($failed) {
+                $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Failed to move [quant,_1,message]',$failed),1);
+                $message .= '<p class="LC_error">'.
+		            join("</p>\n<p class=\"LC_error\">",@failed_msg).
+		            "</p>\n";
+            }
+            $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Moved [quant,_1,message]',$total));
+            $message = &Apache::loncommon::confirmwrapper($message);
+            $r->print($message);
+          # $r->print('<p>');
         }
 	&Apache::loncommunicate::menu($r);
 	&disall($r,($folder?$folder:$dismode),$msgstatus);
@@ -3492,18 +3501,17 @@
 	    }
 	}
 	&printheader($r,'','Deleted Messages');
+        my $message = '';
 	if ($failed) {
-            $r->print('<p class="LC_error">'
-                     .&mt('Failed to delete [quant,_1,message]',$failed)
-                     .'</p>');
-	    $r->print('<p class="LC_error">'.
+            $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Failed to delete [quant,_1,message]',$failed),1);
+            $message .= '<p class="LC_error">'.
 		      join("</p>\n<p class=\"LC_error\">",@failed_msg).
-		      "</p>\n");
+		      "</p>\n";
 	}
-        $r->print('<p class="LC_success">'
-                 .&mt('Deleted [quant,_1,message]',$total)
-                 .'</p>'
-                 .'<p>');
+        $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Deleted [quant,_1,message]',$total));
+        $message = &Apache::loncommon::confirmwrapper($message);
+        $r->print($message);
+      # $r->print('<p>');
 	&Apache::loncommunicate::menu($r);
 	&disall($r,($folder?$folder:$dismode),$msgstatus);
     } elsif ($env{'form.markunread'}) {
@@ -3559,19 +3567,19 @@
             }
             if (keys(%forwardok) > 0) {
                 my $count = keys(%forwardok);
-                $r->print('<br /><span class="LC_success">'.
-                          &mt('[quant,_1,message] forwarded.',$count).
-                          '</span>');
+                my $message = &Apache::lonhtmlcommon::confirm_success(&mt('[quant,_1,message] forwarded.',$count));
+                $message = &Apache::loncommon::confirmwrapper($message);
+                $r->print($message);
             }
             if (keys(%forwardfail) > 0) {
                 my $count = keys(%forwardfail);
-                $r->print('<p><span class="LC_error">'.
-                          &mt('Could not forward [quant,_1,message].',$count).
-                          '</span> ');
+                my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Could not forward [quant,_1,message].',$count),1);
                 foreach my $key (keys(%forwardfail)) {
-                    $r->print(&mt('Could not deliver forwarded message.').'</span> '.
-                              &mt('The recipient addresses may need to be corrected').' ('.$forwardfail{$key}.').<br /><br />');
+                    $message .= '<br/>'.&mt('Could not deliver forwarded message.').'</span> '.
+                                &mt('The recipient addresses may need to be corrected').' ('.$forwardfail{$key}.')';
                 }
+                $message = &Apache::loncommon::confirmwrapper($message);
+                $r->print($message);
             }
             &Apache::loncommunicate::menu($r);
         } else {
@@ -3595,14 +3603,13 @@
         my $showfolder = $env{'form.newfolder'};
 	my ($makeresult,$warning) = &makefolder($env{'form.newfolder'});
         if ($makeresult eq 'ok') {
-            $r->print('<p class="LC_success">'
-                     .&mt('Folder "[_1]" created.',$showfolder)
-                     .'</p>');
+            my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Folder "[_1]" created.',$showfolder));
+            $message = &Apache::loncommon::confirmwrapper($message);
+            $r->print($message);
         } else {
-            $r->print('<p class="LC_warning">'
-                     .&mt('Creation failed.').' '.$makeresult.'<br />'
-                     .$warning
-                     .'</p>');
+            my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Creation failed.').' '.$makeresult.'<br />'.$warning,1);
+            $message = &Apache::loncommon::confirmwrapper($message);
+            $r->print($message);
             $showfolder = $folder;
         }
         &Apache::loncommunicate::menu($r);
@@ -3614,14 +3621,14 @@
         my $showfolder = '';
         my $delresult = &deletefolder($folder);
         if ($delresult eq 'ok') {
-            $r->print('<p class="LC_success">'
-                     .&mt('Folder "[_1]" deleted.',$folder)
-                     .'</p>');
+            my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Folder "[_1]" deleted.',$folder));
+            $message = &Apache::loncommon::confirmwrapper($message);
+            $r->print($message);
             $env{'form.folder'} = '';
         } else {
-            $r->print('<p class="LC_warning">'
-                     .&mt('Deletion failed.').' '.$delresult
-                     .'</p>');
+            my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Deletion failed.').' '.$delresult,1);
+            $message = &Apache::loncommon::confirmwrapper($message);
+            $r->print($message);
             $showfolder = $folder;
         }
         &Apache::loncommunicate::menu($r);
@@ -3631,13 +3638,13 @@
         my $showfolder = $env{'form.renamed'};
         my $renresult = &renamefolder($folder);
         if ($renresult eq 'ok') {
-            $r->print('<p class="LC_success">'
-                     .&mt('Folder "[_1]" renamed to "[_2]".',$folder,$showfolder)
-                     .'</p>');
+            my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Folder "[_1]" renamed to "[_2]".',$folder,$showfolder));
+            $message = &Apache::loncommon::confirmwrapper($message);
+            $r->print($message);
         } else {
-            $r->print('<p class="LC_warning">'
-                     .&mt('Renaming failed.').' '.$renresult
-                     .'</p>');
+            my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Renaming failed.').' '.$renresult,1);
+            $message = &Apache::loncommon::confirmwrapper($message);
+            $r->print($message);
             $showfolder = $folder;
         }
         &Apache::loncommunicate::menu($r);

--wenzelju1264080581--