--- loncom/interface/lonsyllabus.pm 2006/03/07 21:36:20 1.47 +++ loncom/interface/lonsyllabus.pm 2010/02/17 18:42:38 1.106.2.5 @@ -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.106.2.5 2010/02/17 18:42:38 faziophi 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,17 @@ use Apache::lonannounce; use Apache::lonlocal; use Apache::lonhtmlcommon; use Apache::lonspeller(); +use HTML::Entities(); +use Digest::MD5 qw(md5_hex); +use Storable qw(freeze thaw); + +# These are strings representing types of fields +# that will used to parse/display a field correctly +use constant { + TYPE_TEXT_HTML => 'html', #<-- default + TYPE_TEXT_PLAIN => 'text', + TYPE_URL_INCLUDE => 'include-url', +}; sub handler { my $r = shift; @@ -50,85 +62,37 @@ 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'},['delete', 'rename', 'field', 'forcestudent','register','forceedit','forceflush','wrapperdisplay']); # ----------------------------------------------------- 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; } # ------------------------------------- There is such a course, get environment my %courseenv=&Apache::lonnet::dump('environment',$cdom,$cnum); # ------------------------------------------------------------ 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(<