--- loncom/interface/lonsyllabus.pm 2006/03/07 21:36:20 1.47 +++ loncom/interface/lonsyllabus.pm 2013/05/15 17:47:57 1.125 @@ -1,7 +1,7 @@ # The LearningOnline Network # Syllabus # -# $Id: lonsyllabus.pm,v 1.47 2006/03/07 21:36:20 www Exp $ +# $Id: lonsyllabus.pm,v 1.125 2013/05/15 17:47:57 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -29,6 +29,7 @@ package Apache::lonsyllabus; use strict; +use Apache::lontemplate; use Apache::Constants qw(:common); use Apache::loncommon; use Apache::lonnet; @@ -38,6 +39,7 @@ use Apache::lonannounce; use Apache::lonlocal; use Apache::lonhtmlcommon; use Apache::lonspeller(); +use HTML::Entities(); sub handler { my $r = shift; @@ -50,82 +52,110 @@ sub handler { my (undef,undef,$cdom,$cnum)=split(/\//,$r->uri); # ------------------------------------------------------------ Get query string &Apache::loncommon::get_unprocessed_cgi - ($ENV{'QUERY_STRING'},['forcestudent','register','forceedit','wrapperdisplay']); + ($ENV{'QUERY_STRING'},['register','forceedit','todocs', + 'folderpath','title']); # ----------------------------------------------------- Is this even a course? my $homeserver=&Apache::lonnet::homeserver($cnum,$cdom); if ($homeserver eq 'no_host') { &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; - $r->print('
'.&mt('No syllabus available').''); + &Apache::loncommon::simple_error_page($r,'No syllabus available', + 'No syllabus available'); + return OK; + } elsif (!&Apache::lonnet::is_course($cdom,$cnum)) { + &Apache::loncommon::content_type($r,'text/html'); + $r->send_http_header; + &Apache::loncommon::simple_error_page($r,'No syllabus available', + 'The course/community for which the syllabus was requested does not exist.'); return OK; } # ------------------------------------- There is such a course, get environment my %courseenv=&Apache::lonnet::dump('environment',$cdom,$cnum); + my $crstype = &Apache::loncommon::course_type(); # ------------------------------------------------------------ Print the screen - my $feedurl='http://'.$ENV{'HTTP_HOST'}.'/public/'.$cdom.'/'.$cnum.'/Course_Announcements.rss'; - if ($target ne 'tex') { - my $html=&Apache::lonxml::xmlbegin(); - $r->print(<