version 1.56, 2006/06/29 15:23:59
|
version 1.63, 2006/12/05 02:55:51
|
Line 37 use Apache::lonnavmaps();
|
Line 37 use Apache::lonnavmaps();
|
use Apache::lonrss(); |
use Apache::lonrss(); |
use Apache::lonnet; |
use Apache::lonnet; |
use HTML::Entities(); |
use HTML::Entities(); |
|
use LONCAPA qw(:match); |
|
|
my %todayhash; |
my %todayhash; |
my %showedcheck; |
my %showedcheck; |
Line 80 sub readcalendar {
|
Line 81 sub readcalendar {
|
$returnhash{$courseid.'@'.$item}=$thiscal{$item}; |
$returnhash{$courseid.'@'.$item}=$thiscal{$item}; |
} |
} |
} |
} |
|
my $can_see_hidden = ($env{'request.role.adv'} && |
my $can_see_hidden = $env{'request.role.adv'}; |
($courseid eq $env{'request.course.id'})); |
my $navmap;# = Apache::lonnavmaps::navmap->new(); |
|
|
my $navmap; |
|
if ($courseid eq $env{'request.course.id'}) { |
|
$navmap = Apache::lonnavmaps::navmap->new(); |
|
} |
my %resourcedata= |
my %resourcedata= |
&Apache::lonnet::dump('resourcedata',$coursedom,$coursenum); |
&Apache::lonnet::dump('resourcedata',$coursedom,$coursenum); |
foreach my $thiskey (sort keys %resourcedata) { |
foreach my $thiskey (sort keys %resourcedata) { |
if ($resourcedata{$thiskey.'.type'}=~/^date/) { |
if ($resourcedata{$thiskey.'.type'}=~/^date/) { |
my ($course,$middle,$part,$name)= |
my ($course,$middle,$part,$name)= |
($thiskey=~/^(\w+)\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/); |
($thiskey=~/^($match_courseid)\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/); |
my %data = ( 'section' => &mt('All Students')); |
my %data = ( 'section' => &mt('All Students')); |
if ($middle=~/^\[(.*)\]\./) { |
if ($middle=~/^\[(.*)\]\./) { |
my $sec=$1; |
my $sec=$1; |
Line 241 sub listcell {
|
Line 246 sub listcell {
|
foreach my $item (@items) { |
foreach my $item (@items) { |
if (ref($item)) { |
if (ref($item)) { |
my ($courseid,$start,$end,$msg)=@$item; |
my ($courseid,$start,$end,$msg)=@$item; |
&Apache::lonnet::logthis(" msg2 is ".ref($msg)." $msg "); |
|
my $fullmsg=&Apache::lonlocal::locallocaltime($start); |
my $fullmsg=&Apache::lonlocal::locallocaltime($start); |
if ($start!=$end) { |
if ($start!=$end) { |
$fullmsg.=&mt(' to '). |
$fullmsg.=&mt(' to '). |
Line 280 sub display_msg {
|
Line 284 sub display_msg {
|
|
|
my $output = $msg->{'datetype'}. ': '.$msg->{'realm'}; |
my $output = $msg->{'datetype'}. ': '.$msg->{'realm'}; |
if (exists($msg->{'url'})) { |
if (exists($msg->{'url'})) { |
$output .= ': '.&Apache::lonnet::gettitle($msg->{'url'}); |
my $displayurl=&Apache::lonnet::gettitle($msg->{'url'}); |
|
if ($msg->{'url'}!~/\Q$displayurl\E$/) { |
|
$output .= ' - '.$displayurl; |
|
} |
} |
} |
if (exists($msg->{'symb'})) { |
if (exists($msg->{'symb'})) { |
$output .= ': '.&Apache::lonnet::gettitle($msg->{'symb'}); |
my $displaysymb=&Apache::lonnet::gettitle($msg->{'symb'}); |
|
if ($msg->{'symb'}!~/\Q$displaysymb\E$/) { |
|
$output .= ' - '.$displaysymb; |
|
} |
} |
} |
$output .= ' ('.$msg->{'section'}.') '; |
$output .= ' ('.$msg->{'section'}.') '; |
return $output; |
return $output; |
Line 300 sub showday {
|
Line 310 sub showday {
|
$nextday+=$oneday; |
$nextday+=$oneday; |
} |
} |
foreach my $item (keys(%allcal)) { |
foreach my $item (keys(%allcal)) { |
my ($course,$startdate,$enddate)=($item=~/^(\w+)\@(\d+)\_(\d+)$/); |
my ($course,$startdate,$enddate)=($item=~/^($match_courseid)\@(\d+)\_(\d+)$/); |
if (($startdate<$nextday) && ($enddate>=$tk)) { |
if (($startdate<$nextday) && ($enddate>=$tk)) { |
push(@outp,[$course,$startdate,$enddate,$allcal{$item}]); |
push(@outp,[$course,$startdate,$enddate,$allcal{$item}]); |
} |
} |
Line 349 ENDDIA
|
Line 359 ENDDIA
|
# ----------------------------------------------------- Summarize all calendars |
# ----------------------------------------------------- Summarize all calendars |
sub get_all_calendars { |
sub get_all_calendars { |
my %allcal=(); |
my %allcal=(); |
foreach my $course (sort(&Apache::loncommon::findallcourses())) { |
my %courses = &Apache::loncommon::findallcourses(); |
|
foreach my $course (sort(keys(%courses))) { |
%allcal=(%allcal,&readcalendar($course)); |
%allcal=(%allcal,&readcalendar($course)); |
} |
} |
return %allcal; |
return %allcal; |
Line 365 sub output_ics_file {
|
Line 376 sub output_ics_file {
|
$r->print("PRODID:-//LONCAPA//LONCAPA Calendar Output//EN$crlf"); |
$r->print("PRODID:-//LONCAPA//LONCAPA Calendar Output//EN$crlf"); |
my %allcal=&get_all_calendars(); |
my %allcal=&get_all_calendars(); |
foreach my $event (keys(%allcal)) { |
foreach my $event (keys(%allcal)) { |
my ($courseid,$startdate,$enddate)=($event=~/^(\w+)\@(\d+)\_(\d+)$/); |
my ($courseid,$startdate,$enddate)=($event=~/^($match_courseid)\@(\d+)\_(\d+)$/); |
my $uid=$event; |
my $uid=$event; |
$uid=~s/[\W\_]/-/gs; |
$uid=~s/[\W\_]/-/gs; |
$uid.='@loncapa'; |
$uid.='@loncapa'; |
Line 486 SERVERANNOUNCE
|
Line 497 SERVERANNOUNCE
|
# list servers |
# list servers |
foreach my $host (sort(keys(%Apache::lonnet::hostname))) { |
foreach my $host (sort(keys(%Apache::lonnet::hostname))) { |
if (&Apache::lonnet::allowed('psa',$Apache::lonnet::hostdom{$host})) { |
if (&Apache::lonnet::allowed('psa',$Apache::lonnet::hostdom{$host})) { |
$r->print ('<br /><input type="checkbox" name="postto_'.$host.'" /> '. |
$r->print ('<br /><label><input type="checkbox" name="postto_'.$host.'" /> '. |
$host.' <tt>'.$Apache::lonnet::hostname{$host}.'</tt> '. |
$host.' <tt>'.$Apache::lonnet::hostname{$host}.'</tt> '. |
'<a href="http://'.$Apache::lonnet::hostname{$host}. |
'</label><a href="http://'.$Apache::lonnet::hostname{$host}. |
'/announcement.txt" target="annowin">current</a>'); |
'/announcement.txt" target="annowin">current</a>'); |
} |
} |
} |
} |