--- loncom/interface/lonmsgdisplay.pm 2010/01/13 18:23:01 1.141
+++ loncom/interface/lonmsgdisplay.pm 2010/01/25 18:09:42 1.145
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines for messaging display
#
-# $Id: lonmsgdisplay.pm,v 1.141 2010/01/13 18:23:01 bisitz Exp $
+# $Id: lonmsgdisplay.pm,v 1.145 2010/01/25 18:09:42 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1311,9 +1311,9 @@ sub compout {
&printheader($r,'/adm/email?compose=multiforward',
'Forwarding Multiple Messages');
if ($multiforward > 1) {
- $r->print(&mt('Each of the [quant,_1,message] you checked'
+ $r->print(&mt('Each of the[_1] [quant,_2,message] [_3]you checked'
.' will be forwarded to the recipient(s) you select below.'
- ,''.$multiforward.'')
+ ,'',$multiforward,'')
.'
');
} else {
$r->print(&mt('The message you checked will be forwarded to the recipient(s) you select below.').'
');
@@ -1844,9 +1844,9 @@ sub retrieve_instructor_comments {
sub disfacetoface {
my ($r,$user,$domain,$target)=@_;
- if ($target eq '') {
- my $target=$env{'form.grade_target'};
- }
+ if ($target eq '') {
+ $target=$env{'form.grade_target'};
+ }
unless ($env{'request.course.id'}) { return; }
if (!&Apache::lonnet::allowed('dff',$env{'request.course.id'})
&& ! &Apache::lonnet::allowed('dff',$env{'request.course.id'}.
@@ -2229,7 +2229,7 @@ sub display_blocker_status {
'.&Apache::lonhtmlcommon::confirm_success(&mt('Could not deliver message'),1).'
'.
- &mt('Please use the browser "Back" button and correct the recipient addresses ([_1]).',$sendstatus).'
'. - &mt('Failed to delete the message.').'
'. - ''.$msg."
\n"); + my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Failed to delete the message.'),1); + $message .= ''.$msg.'
'; + $message = &Apache::loncommon::confirmwrapper($message); + $r->print($message); } &Apache::loncommunicate::menu($r); &disall($r,($folder?$folder:$dismode),$msgstatus); @@ -3422,7 +3433,10 @@ sub handler { $total ++; } &printheader($r,'','Marked Messages Read'); - $r->print(&mt('Marked [quant,_1,message] read',$total).''); + my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Marked [quant,_1,message] read',$total)); + $message = &Apache::loncommon::confirmwrapper($message); + $r->print($message); + # $r->print('
'); &Apache::loncommunicate::menu($r); &disall($r,($folder?$folder:$dismode),$msgstatus); } elsif ($env{'form.markedaction'} eq 'markedunread') { @@ -3433,7 +3447,10 @@ sub handler { $total ++; } &printheader($r,'','Marked Messages Unread'); - $r->print(&mt('Marked [quant,_1,message] unread',$total).'
'); + my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Marked [quant,_1,message] unread',$total)); + $message = &Apache::loncommon::confirmwrapper($message); + $r->print($message); + # $r->print('
'); &Apache::loncommunicate::menu($r); &disall($r,($folder?$folder:$dismode),$msgstatus); } elsif ($env{'form.markedaction'} eq 'markedmove') { @@ -3456,18 +3473,17 @@ sub handler { push(@failed_msg,$msg); } } - if ($failed) { - $r->print('
' - .&mt('Failed to move [quant,_1,message]',$failed) - .'
'); - $r->print(''. - join("
\n",@failed_msg). - "
\n"); - } - $r->print('' - .&mt('Moved [quant,_1,message]',$total) - .'
' - .''); + my $message = ''; + if ($failed) { + $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Failed to move [quant,_1,message]',$failed),1); + $message .= '
'. + join("
\n",@failed_msg). + "
\n"; + } + $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Moved [quant,_1,message]',$total)); + $message = &Apache::loncommon::confirmwrapper($message); + $r->print($message); + # $r->print(''); } &Apache::loncommunicate::menu($r); &disall($r,($folder?$folder:$dismode),$msgstatus); @@ -3485,18 +3501,17 @@ sub handler { } } &printheader($r,'','Deleted Messages'); + my $message = ''; if ($failed) { - $r->print('
' - .&mt('Failed to delete [quant,_1,message]',$failed) - .'
'); - $r->print(''. + $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Failed to delete [quant,_1,message]',$failed),1); + $message .= '
'. join("
\n",@failed_msg). - "
\n"); + "\n"; } - $r->print('' - .&mt('Deleted [quant,_1,message]',$total) - .'
' - .''); + $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Deleted [quant,_1,message]',$total)); + $message = &Apache::loncommon::confirmwrapper($message); + $r->print($message); + # $r->print('
');
&Apache::loncommunicate::menu($r);
&disall($r,($folder?$folder:$dismode),$msgstatus);
} elsif ($env{'form.markunread'}) {
@@ -3552,19 +3567,19 @@ sub handler {
}
if (keys(%forwardok) > 0) {
my $count = keys(%forwardok);
- $r->print('
'.
- &mt('[quant,_1,message] forwarded.',$count).
- '');
+ 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('
'.
- &mt('Could not forward [quant,_1,message].',$count).
- ' ');
+ 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.').' '.
- &mt('The recipient addresses may need to be corrected').' ('.$forwardfail{$key}.').
');
+ $message .= '
'.&mt('Could not deliver forwarded message.').' '.
+ &mt('The recipient addresses may need to be corrected').' ('.$forwardfail{$key}.')';
}
+ $message = &Apache::loncommon::confirmwrapper($message);
+ $r->print($message);
}
&Apache::loncommunicate::menu($r);
} else {
@@ -3588,14 +3603,13 @@ sub handler {
my $showfolder = $env{'form.newfolder'};
my ($makeresult,$warning) = &makefolder($env{'form.newfolder'});
if ($makeresult eq 'ok') {
- $r->print('
' - .&mt('Folder "[_1]" created.',$showfolder) - .'
'); + my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Folder "[_1]" created.',$showfolder)); + $message = &Apache::loncommon::confirmwrapper($message); + $r->print($message); } else { - $r->print(''
- .&mt('Creation failed.').' '.$makeresult.'
'
- .$warning
- .'
' - .&mt('Folder "[_1]" deleted.',$folder) - .'
'); + 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('' - .&mt('Deletion failed.').' '.$delresult - .'
'); + 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); @@ -3624,13 +3638,13 @@ sub handler { my $showfolder = $env{'form.renamed'}; my $renresult = &renamefolder($folder); if ($renresult eq 'ok') { - $r->print('' - .&mt('Folder "[_1]" renamed to "[_2]".',$folder,$showfolder) - .'
'); + 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('' - .&mt('Renaming failed.').' '.$renresult - .'
'); + 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);