--- loncom/interface/lonannounce.pm 2012/02/22 18:38:29 1.83 +++ loncom/interface/lonannounce.pm 2012/04/18 16:22:31 1.84 @@ -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.84 2012/04/18 16:22:31 bisitz 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('
' .'

'.&mt('Post Server Announcements').'

' .&mt('Post announcements to the system login and roles screen').'
'