--- loncom/interface/lonannounce.pm 2012/02/22 18:38:29 1.83
+++ loncom/interface/lonannounce.pm 2012/08/21 14:36:27 1.85
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Announce
#
-# $Id: lonannounce.pm,v 1.83 2012/02/22 18:38:29 bisitz Exp $
+# $Id: lonannounce.pm,v 1.85 2012/08/21 14:36:27 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -569,15 +569,29 @@ ENDDOCUMENT
}
# ------------------------------------------------------------ Process commands
if ($serverpost) {
- if ($env{'form.serveraction'}) {
- foreach my $key (keys(%env)) {
- if ($key=~/^form\.postto\_(\w+[\w|-]*)/) {
- $r->print(
- '
Posting '.$1.': '.&Apache::lonnet::postannounce
- ($1,$env{'form.serverannnounce'}));
- }
- }
- }
+ if ($env{'form.serveraction'}) {
+ my $rc;
+ my $message;
+ foreach my $key (keys(%env)) {
+ if ($key=~/^form\.postto\_(\w+[\w\-]*)/) {
+ $rc = &Apache::lonnet::postannounce
+ ($1,$env{'form.serverannnounce'});
+ if ($rc eq 'ok') {
+ $message .=
+ &Apache::lonhtmlcommon::confirm_success(
+ &mt('Announcement posted to [_1]',$1))
+ .'
';
+ } else {
+ $message .=
+ &Apache::lonhtmlcommon::confirm_success(
+ &mt('Posting announcement to [_1] failed: [_2]'
+ ,$1,$rc), 1)
+ .'
';
+ }
+ }
+ }
+ $r->print(&Apache::loncommon::confirmwrapper($message));
+ }
$r->print('