version 1.40, 2005/04/07 06:56:23
|
version 1.43, 2005/11/17 22:36:37
|
Line 47 sub handler {
|
Line 47 sub handler {
|
|
|
# ------------------------------------------------------------ Print the screen |
# ------------------------------------------------------------ Print the screen |
my $target=$env{'form.grade_target'}; |
my $target=$env{'form.grade_target'}; |
|
my (undef,undef,$cdom,$cnum)=split(/\//,$r->uri); |
|
my $feedurl='feed://'.$ENV{'HTTP_HOST'}.'/public/'.$cdom.'/'.$cnum.'/Course_Announcements.rss'; |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
my $html=&Apache::lonxml::xmlbegin(); |
my $html=&Apache::lonxml::xmlbegin(); |
$r->print(<<ENDDOCUMENT); |
$r->print(<<ENDDOCUMENT); |
$html |
$html |
<head> |
<head> |
<title>The LearningOnline Network with CAPA</title> |
<title>The LearningOnline Network with CAPA</title> |
|
<link rel="alternate" type="application/rss+xml" title="Course Announcements" href="$feedurl" /> |
ENDDOCUMENT |
ENDDOCUMENT |
} else { |
} else { |
$r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'})); |
$r->print(&Apache::lonprintout::print_latex_header($env{'form.latex_type'})); |
} |
} |
my (undef,undef,$cdom,$cnum)=split(/\//,$r->uri); |
|
# Is this even a course? |
# Is this even a course? |
my $homeserver=&Apache::lonnet::homeserver($cnum,$cdom); |
my $homeserver=&Apache::lonnet::homeserver($cnum,$cdom); |
if ($homeserver eq 'no_host') { |
if ($homeserver eq 'no_host') { |
Line 113 ENDDOCUMENT
|
Line 116 ENDDOCUMENT
|
# -------------------------------------------------------------- Announcements? |
# -------------------------------------------------------------- Announcements? |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
$r->print(&Apache::lonannounce::showday(time,2, |
$r->print(&Apache::lonannounce::showday(time,2, |
&Apache::lonannounce::readcalendar($cdom.'_'.$cnum))); |
&Apache::lonannounce::readcalendar($cdom.'_'.$cnum)). |
|
'<p>'.&mt('Course Announcement RSS Feed').': '. |
|
'<a href="'.$feedurl.'"><tt>'.$feedurl.'</tt></a></p>'); |
} else { |
} else { |
$r->print(&Apache::lonxml::xmlparse($r,'tex', |
$r->print(&Apache::lonxml::xmlparse($r,'tex', |
&Apache::lonannounce::showday(time,2, |
&Apache::lonannounce::showday(time,2, |
Line 285 ENDDOCUMENT
|
Line 290 ENDDOCUMENT
|
$r->print($message); |
$r->print($message); |
} |
} |
} else { |
} else { |
$message=~s/\n/\<br \/\>/g; |
&Apache::lonfeedback::newline_to_br(\$message); |
$message |
$message |
=~s/(https*\:\/\/[^\s]+)/\<a href=\"$1\"\>\<tt\>$1\<\/tt\>\<\/a\>/g; |
=~s/(https*\:\/\/[^\s]+)/\<a href=\"$1\"\>\<tt\>$1\<\/tt\>\<\/a\>/g; |
if ($allowed) { |
if ($allowed) { |