--- loncom/interface/lonannounce.pm 2003/09/02 21:15:59 1.18 +++ loncom/interface/lonannounce.pm 2003/09/03 01:53:46 1.19 @@ -1,7 +1,7 @@ # The LearningOnline Network # Announce # -# $Id: lonannounce.pm,v 1.18 2003/09/02 21:15:59 www Exp $ +# $Id: lonannounce.pm,v 1.19 2003/09/03 01:53:46 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -86,7 +86,8 @@ sub normalcell { ', '.localtime($start).' - '.localtime($end).': '.$msg; if ($courseid eq $ENV{'request.course.id'}) { if ((&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) - && (!$showedcheck{$start.'_'.$end})) { + && (!$showedcheck{$start.'_'.$end}) + && ($ENV{'form.pickdate'} ne 'yes')) { $output.=''; $showedcheck{$start.'_'.$end}=1; @@ -102,7 +103,7 @@ sub normalcell { ((($day eq $todayhash{'day'}) && ($month eq $todayhash{'month'}) && ($year eq $todayhash{'year'}))?' bgcolor="#FFFF00"':''). - '>'.$day.'
'.$output.''; + '>'.&tfont(''.&picklink($day,$day,$month,$year).'
'.$output).''; } sub plaincell { @@ -171,6 +172,43 @@ sub showday { } } +sub tfont { + my $text=shift; + if ($ENV{'form.pickdate'} eq 'yes') { + return ''.$text.''; + } else { + return $text; + } +} + +sub picklink { + my ($text,$day,$month,$year)=@_; + if ($ENV{'form.pickdate'} eq 'yes') { + return ''. + $text.''; + } else { + return $text; + } +} + +sub dialscript { + return (< +function dialin(day,month,year) { + opener.document.$ENV{'form.formname'}.$ENV{'form.element'}\_year.value=year; + var slct=opener.document.$ENV{'form.formname'}.$ENV{'form.element'}\_month; + var i; + for (i=0;i +ENDDIA +} + sub handler { my $r = shift; $r->content_type('text/html'); @@ -185,7 +223,7 @@ sub handler { undef %showedcheck; # ---------------------------------------------------------- Get month and year &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, - ['month','year','pickdate']); + ['month','year','pickdate','formname','element']); # --------------------------------------------------- Decide what month to show my $year=$todayhash{'year'}; if ($ENV{'form.year'}) { $year=$ENV{'form.year'}; } @@ -194,7 +232,8 @@ sub handler { # ---------------------------------------------- See if we are in pickdate mode my $pickdatemode=($ENV{'form.pickdate'} eq 'yes'); - + my $pickinfo='&pickdate=yes&formname='.$ENV{'form.formname'}. + '&element='.$ENV{'form.element'}; # --------------------------------------------- Find out first day of the month my %firstday=&Apache::loncommon::timehash( @@ -226,6 +265,7 @@ ENDDOCUMENT if ($pickdatemode) { # no big header in pickdate mode $r->print(&Apache::loncommon::bodytag("Pick a Date",'','',1). + &dialscript(). ''); } else { $r->print(&Apache::loncommon::bodytag("Announcements and Calendar")); @@ -339,14 +379,27 @@ SERVERANNOUNCE } $r->print( 'Previous Month '. + ($pickdatemode?$pickinfo:'').'">Previous Month '. 'Next Month'. + ($pickdatemode?$pickinfo:'').'">Next Month'. '   Current Month

'. - ''. - ''); + ($pickdatemode?$pickinfo:'').'">Current Month

'. + '

SunMonTueWedThuFriSat
'); my $tk=&Apache::loncommon::maketime(%firstday); my $outp; @@ -379,12 +432,12 @@ SERVERANNOUNCE if ($allowed) { $r->print(''); } $r->print('

'. 'Previous Month '. + ($pickdatemode?$pickinfo:'').'">Previous Month '. 'Next Month'. + ($pickdatemode?$pickinfo:'').'">Next Month'. '   Current Month

'. + ($pickdatemode?$pickinfo:'').'">Current Month

'. ($pickdatemode?'':''). ''); return OK;
'. +&tfont('Sun') +.''. +&tfont('Mon') +.''. +&tfont('Tue') +.''. +&tfont('Wed') +.''. +&tfont('Thu') +.''. +&tfont('Fri') +.''. +&tfont('Sat') +.'