--- loncom/interface/lonannounce.pm 2003/08/12 19:46:04 1.17 +++ loncom/interface/lonannounce.pm 2003/09/02 21:15:59 1.18 @@ -1,7 +1,7 @@ # The LearningOnline Network # Announce # -# $Id: lonannounce.pm,v 1.17 2003/08/12 19:46:04 www Exp $ +# $Id: lonannounce.pm,v 1.18 2003/09/02 21:15:59 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -185,12 +185,16 @@ sub handler { undef %showedcheck; # ---------------------------------------------------------- Get month and year &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, - ['month','year']); + ['month','year','pickdate']); # --------------------------------------------------- Decide what month to show my $year=$todayhash{'year'}; if ($ENV{'form.year'}) { $year=$ENV{'form.year'}; } my $month=$todayhash{'month'}; if ($ENV{'form.month'}) { $month=$ENV{'form.month'}; } + +# ---------------------------------------------- See if we are in pickdate mode + my $pickdatemode=($ENV{'form.pickdate'} eq 'yes'); + # --------------------------------------------- Find out first day of the month my %firstday=&Apache::loncommon::timehash( @@ -219,7 +223,13 @@ sub handler { ENDDOCUMENT - $r->print(&Apache::loncommon::bodytag("Announcements and Calendar")); + if ($pickdatemode) { +# no big header in pickdate mode + $r->print(&Apache::loncommon::bodytag("Pick a Date",'','',1). + ''); + } else { + $r->print(&Apache::loncommon::bodytag("Announcements and Calendar")); + } # does this user have privileges to post, etc? my $allowed=0; if ($ENV{'request.course.id'}) { @@ -233,6 +243,11 @@ ENDDOCUMENT } else { $serverpost=&Apache::lonnet::allowed('psa','/'); } +# -------------------------------- BUT: do no fancy stuff when in pickdate mode + if ($pickdatemode) { + $serverpost=0; + $allowed=0; + } # ------------------------------------------------------------ Process commands if ($serverpost) { if ($ENV{'form.serveraction'}) { @@ -323,10 +338,13 @@ SERVERANNOUNCE return OK; } $r->print( - 'Previous Month '. - 'Next Month'. + 'Previous Month '. + 'Next Month'. '   Current Month

'. + '&year='.$todayhash{'year'}. + ($pickdatemode?'&pickdate=yes':'').'">Current Month

'. ''. ''); @@ -360,10 +378,14 @@ SERVERANNOUNCE # --------------------------------------------------------------- Remove button if ($allowed) { $r->print(''); } $r->print('

'. - 'Previous Month '. - 'Next Month'. + 'Previous Month '. + 'Next Month'. '   Current Month

'. + '&year='.$todayhash{'year'}. + ($pickdatemode?'&pickdate=yes':'').'">Current Month

'. + ($pickdatemode?'':''). ''); return OK; }
SunMonTueWedThuFriSat