version 1.48, 2006/03/23 22:32:10
|
version 1.51, 2006/04/23 07:16:07
|
Line 155 sub readcalendar {
|
Line 155 sub readcalendar {
|
} |
} |
|
|
sub emptycell { |
sub emptycell { |
return '<td bgcolor="#AAAAAA"> </td>'; |
return '<td class="LC_calendar_day_empty"> </td>'; |
} |
} |
|
|
sub normalcell { |
sub normalcell { |
my ($day,$month,$year,$text)=@_; |
my ($day,$month,$year,$text)=@_; |
my $output=''; |
my $output; |
my @items=&order($text); |
my @items=&order($text); |
foreach my $item (@items) { |
foreach my $item (@items) { |
if ($item) { |
if ($item) { |
Line 189 sub normalcell {
|
Line 189 sub normalcell {
|
$fullmsg=~s/[\n\r]/\\n/gs; |
$fullmsg=~s/[\n\r]/\\n/gs; |
$fullmsg=&HTML::Entities::encode($fullmsg,'<>&"\''); |
$fullmsg=&HTML::Entities::encode($fullmsg,'<>&"\''); |
$fullmsg=~s/&/\\&/g; |
$fullmsg=~s/&/\\&/g; |
|
my $short_msg = substr($msg,0,20).((length($msg) > 20)?'...':''); |
|
if (defined($output)) { $output.='<br />'; } |
$output.='<a href="javascript:alert('."'$fullmsg'".')">'. |
$output.='<a href="javascript:alert('."'$fullmsg'".')">'. |
substr($msg,0,20).'...</a><br />'; |
$short_msg.'</a>'; |
} |
} |
} |
} |
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 { |
my ($text)=@_; |
my ($text)=@_; |
my $output=''; |
my $output; |
my @items=&order($text); |
my @items=&order($text); |
foreach my $item (@items) { |
foreach my $item (@items) { |
if ($item) { |
if ($item) { |
Line 217 sub plaincell {
|
Line 219 sub plaincell {
|
$fullmsg=~s/[\n\r]/\\n/gs; |
$fullmsg=~s/[\n\r]/\\n/gs; |
$fullmsg=&HTML::Entities::encode($fullmsg,'<>&"\''); |
$fullmsg=&HTML::Entities::encode($fullmsg,'<>&"\''); |
$fullmsg=~s/&/\\&/g; |
$fullmsg=~s/&/\\&/g; |
|
my $short_msg = substr($msg,0,80).((length($msg) > 80)?'...':''); |
|
if (defined($output)) { $output.='<br />'; } |
$output.='<a href="javascript:alert('."'$fullmsg'".')">'. |
$output.='<a href="javascript:alert('."'$fullmsg'".')">'. |
substr($msg,0,80).'...</a><br />'; |
$short_msg.'</a>'; |
} |
} |
} |
} |
return $output; |
return $output; |
Line 295 sub showday {
|
Line 299 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 337 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 480 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 503 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 516 SERVERANNOUNCE
|
' <a href="/adm/announcements?month='.$todayhash{'month'}. |
' <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 550 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>'); } |