Diff for /loncom/interface/lonannounce.pm between versions 1.48 and 1.49

version 1.48, 2006/03/23 22:32:10 version 1.49, 2006/04/22 16:32:55
Line 155  sub readcalendar { Line 155  sub readcalendar {
 }  }
   
 sub emptycell {  sub emptycell {
     return '<td bgcolor="#AAAAAA">&nbsp;</td>';      return '<td class="LC_calendar_day_empty">&nbsp;</td>';
 }  }
   
 sub normalcell {  sub normalcell {
Line 193  sub normalcell { Line 193  sub normalcell {
        substr($msg,0,20).'...</a><br />';         substr($msg,0,20).'...</a><br />';
        }         }
     }      }
     return '<td valign="top"'.      return '<td class="LC_calendar_day'.
  ((($day eq $todayhash{'day'}) &&   ((($day eq $todayhash{'day'}) &&
           ($month eq $todayhash{'month'}) &&            ($month eq $todayhash{'month'}) &&
           ($year eq $todayhash{'year'}))?' bgcolor="#FFFF00"':'').            ($year eq $todayhash{'year'}))?'_current':'').
            '>'.&tfont('<b>'.&picklink($day,$day,$month,$year).'</b><br />'.$output).'</td>';             '" ><b>'.&picklink($day,$day,$month,$year).'</b><br />'.$output.'</td>';
 }  }
   
 sub plaincell {  sub plaincell {
Line 295  sub showday { Line 295  sub showday {
    }     }
 }  }
   
 sub tfont {  
     my $text=shift;  
     if ($env{'form.pickdate'} eq 'yes') {  
  return '<font size="1">'.$text.'</font>';  
     } else {  
  return $text;  
     }  
 }  
   
 sub picklink {  sub picklink {
     my ($text,$day,$month,$year)=@_;      my ($text,$day,$month,$year)=@_;
     if ($env{'form.pickdate'} eq 'yes') {      if ($env{'form.pickdate'} eq 'yes') {
Line 342  sub handler { Line 333  sub handler {
     my $today=time;      my $today=time;
     %todayhash=&Apache::loncommon::timehash($today);      %todayhash=&Apache::loncommon::timehash($today);
 # ----------------------------------------------------------------- Check marks  # ----------------------------------------------------------------- Check marks
     %showedcheck=();      undef(%showedcheck);
     undef %showedcheck;  
 # ---------------------------------------------------------- Get month and year  # ---------------------------------------------------------- Get month and year
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                              ['month','year','pickdate','formname','element']);                               ['month','year','pickdate','formname','element']);
Line 486  SERVERANNOUNCE Line 476  SERVERANNOUNCE
     }      }
 # ----------------------------------------------------- Summarize all calendars  # ----------------------------------------------------- Summarize all calendars
     my %allcal=();      my %allcal=();
     foreach my $course (&Apache::loncommon::findallcourses()) {      foreach my $course (sort(&Apache::loncommon::findallcourses())) {
  %allcal=(%allcal,&readcalendar($course));   %allcal=(%allcal,&readcalendar($course));
     }      }
   
Line 509  SERVERANNOUNCE Line 499  SERVERANNOUNCE
   &Apache::loncommon::end_page());    &Apache::loncommon::end_page());
  return OK;   return OK;
     }      }
   
       my $class = "LC_calendar";
       if ($env{'form.pickdate'} eq 'yes') {
    $class .= " LC_calendar_pickdate";
       }
     $r->print(      $r->print(
  '<a href="/adm/announcements?month='.$pm.'&year='.$py.   '<a href="/adm/announcements?month='.$pm.'&year='.$py.
  ($pickdatemode?$pickinfo:'').'">'.&mt('Previous Month').'</a> '.   ($pickdatemode?$pickinfo:'').'">'.&mt('Previous Month').'</a> '.
Line 517  SERVERANNOUNCE Line 512  SERVERANNOUNCE
  '&nbsp;&nbsp;&nbsp;<a href="/adm/announcements?month='.$todayhash{'month'}.   '&nbsp;&nbsp;&nbsp;<a href="/adm/announcements?month='.$todayhash{'month'}.
  '&year='.$todayhash{'year'}.   '&year='.$todayhash{'year'}.
  ($pickdatemode?$pickinfo:'').'">'.&mt('Current Month').'</a><p>'.   ($pickdatemode?$pickinfo:'').'">'.&mt('Current Month').'</a><p>'.
         '<table border="2" cols="7" rows="5"><tr><th>'.          '<table class="'.$class.'" cols="7" rows="5"><tr>
 &tfont(&mt('Sun'))  <th>'.&mt('Sun').'</th>
 .'</th><th>'.  <th>'.&mt('Mon').'</th>
 &tfont(&mt('Mon'))  <th>'.&mt('Tue').'</th>
 .'</th><th>'.  <th>'.&mt('Wed').'</th>
 &tfont(&mt('Tue'))  <th>'.&mt('Thu').'</th>
 .'</th><th>'.  <th>'.&mt('Fri').'</th>
 &tfont(&mt('Wed'))  <th>'.&mt('Sat').'</th></tr>');
 .'</th><th>'.  
 &tfont(&mt('Thu'))  
 .'</th><th>'.  
 &tfont(&mt('Fri'))  
 .'</th><th>'.  
 &tfont(&mt('Sat'))  
 .'</th></tr>');  
   
     my $tk=&Apache::loncommon::maketime(%firstday);      my $tk=&Apache::loncommon::maketime(%firstday);
     my $outp;      my $outp;
Line 558  SERVERANNOUNCE Line 546  SERVERANNOUNCE
 # ------------------------------------------------------------------- End table  # ------------------------------------------------------------------- End table
     $r->print('</table>');      $r->print('</table>');
 # ----------------------------------------------------------------- Check marks  # ----------------------------------------------------------------- Check marks
     %showedcheck=();      undef(%showedcheck);
     undef %showedcheck;  
 # --------------------------------------------------------------- Remove button  # --------------------------------------------------------------- Remove button
     if ($allowed) { $r->print('<input type="button" onClick="removesub()" value="Remove Checked Entries">'.      if ($allowed) { $r->print('<input type="button" onClick="removesub()" value="Remove Checked Entries">'.
       &Apache::loncommon::help_open_topic('Calendar_Remove_Announcement').'</form>'); }        &Apache::loncommon::help_open_topic('Calendar_Remove_Announcement').'</form>'); }

Removed from v.1.48  
changed lines
  Added in v.1.49


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>