--- loncom/interface/lonannounce.pm 2005/04/07 06:56:22 1.34 +++ loncom/interface/lonannounce.pm 2005/11/22 16:16:53 1.38 @@ -1,7 +1,7 @@ # The LearningOnline Network # Announce # -# $Id: lonannounce.pm,v 1.34 2005/04/07 06:56:22 albertel Exp $ +# $Id: lonannounce.pm,v 1.38 2005/11/22 16:16:53 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -33,6 +33,7 @@ use Apache::Constants qw(:common); use Apache::loncommon; use Apache::lonhtmlcommon(); use Apache::lonlocal; +use Apache::lonrss(); use Apache::lonnet; use HTML::Entities(); @@ -49,14 +50,21 @@ sub editfield { 'enddate', $end); my $help=&Apache::loncommon::help_open_menu('','Calendar Add Announcement','Calendar_Add_Announcement','',274,'Communication Tools'); + my %lt=&Apache::lonlocal::texthash('post' => 'Post Announcement', + 'start' => 'Starting date', + 'end' => 'Ending date', + 'incrss' => 'Include in course RSS newsfeed'); + $r->print(< - - -
Starting date:$startdateform
Ending date:$enddateform
+ + +
$lt{'start'}:$startdateform
$lt{'end'}:$enddateform
-
+
+ +

ENDFORM } @@ -191,7 +199,7 @@ sub plaincell { $fullmsg=&HTML::Entities::encode($fullmsg,'<>&"\''); $fullmsg=~s/&/\\&/g; $output.=''. - substr($msg,0,40).'...
'; + substr($msg,0,80).'...
'; } } return $output; @@ -421,6 +429,13 @@ SERVERANNOUNCE &Apache::lonnet::put('calendar',{ $startdate.'_'.$enddate => $env{'form.msg'} },$coursedom,$coursenum); + if ($env{'form.rsspost'}) { + &Apache::lonrss::addentry($coursenum,$coursedom,'Course_Announcements', + &mt('Event from [_1] to [_2]', + &Apache::lonlocal::locallocaltime($startdate), + &Apache::lonlocal::locallocaltime($enddate)), + $env{'form.msg'},'/adm/announcements','public'); + } } # ---------------------------------------------------------------- Remove items if ($env{'form.action'} eq 'del') {