--- loncom/interface/lonsyllabus.pm 2013/08/31 18:58:57 1.131 +++ loncom/interface/lonsyllabus.pm 2014/01/09 15:18:40 1.136 @@ -1,7 +1,7 @@ # The LearningOnline Network # Syllabus # -# $Id: lonsyllabus.pm,v 1.131 2013/08/31 18:58:57 raeburn Exp $ +# $Id: lonsyllabus.pm,v 1.136 2014/01/09 15:18:40 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -35,6 +35,7 @@ use Apache::loncommon; use Apache::lonnet; use Apache::lontexconvert; use Apache::lonfeedback; +use Apache::lonhtmlgateway; use Apache::lonannounce; use Apache::lonlocal; use Apache::lonhtmlcommon; @@ -53,7 +54,7 @@ sub handler { # ------------------------------------------------------------ Get query string &Apache::loncommon::get_unprocessed_cgi ($ENV{'QUERY_STRING'},['register','forceedit','todocs', - 'folderpath','title']); + 'folderpath','title','only_body']); # ----------------------------------------------------- Is this even a course? my $homeserver=&Apache::lonnet::homeserver($cnum,$cdom); if ($homeserver eq 'no_host') { @@ -97,7 +98,7 @@ sub handler { my $uploaded=$courseenv{'uploadedsyllabus'}; my $minimal=$courseenv{'minimalsyllabus'}; - if (($minimal =~/\w/) || ($uploaded =~/\w/)) { + if (($minimal =~/\w/) || ($uploaded =~/\w/)) { my $item; if ($minimal =~/\w/) { if ($external =~ m{\Q$minimal\E$}) { @@ -125,6 +126,9 @@ sub handler { $env{'form.texengine'}); my %args; &get_breadcrumbs($cdom,$cnum,$crstype,\%args); + if ($env{'form.only_body'}) { + $args{'only_body'} = 1; + } $r->print(&Apache::loncommon::start_page("Syllabus",undef,\%args). $result. &Apache::loncommon::end_page()); @@ -406,7 +410,7 @@ sub handler { } $rsslinktext = &mt('Manage Course RSS Feeds/Blogs'); if ($crstype eq 'Community') { - $rsslinktext = &mt('Manage Communiity RSS Feeds/Blogs'); + $rsslinktext = &mt('Manage Community RSS Feeds/Blogs'); } } my $editurl= &Apache::lonnet::absolute_url().'/adm/'.$cdom.'/'.$cnum.'/_rss.html'; @@ -692,6 +696,9 @@ ENDSCRIPT ); $args->{'add_entries'} = \%loaditem; } + if ($env{'form.only_body'}) { + $args->{'only_body'} = 1; + } my $start_page = &Apache::loncommon::start_page("Syllabus", $rss_link.$js,$args); if ($start_page) { @@ -1168,10 +1175,8 @@ sub save_changes { foreach my $syl_field (keys(%{$syllabusfields})) { my $field=$env{'form.'.$syl_field}; chomp($field); - $field=~s/\s+$//s; - $field=~s/^\s+//s; - $field=~s/\$//s; - $field=&Apache::lonfeedback::clear_out_html($field,1); + my $gateway = Apache::lonhtmlgateway->new(); + $field = $gateway->process_incoming_html($field,1); #here it will be stored $syllabus->{$syl_field}=$field; if ($syl_field eq 'lll_includeurl') { # clean up included URLs @@ -1266,7 +1271,7 @@ sub save_changes { ($url,$needlink) = &process_upload(\$output,$cnum,$cdom, \%allfiles,\%codebase); } else { - $output = '
'; + $output = '
'. &mt('No file uploaded'). '
'; } @@ -1498,7 +1503,7 @@ sub home_http_host { if ($home ne 'no_host') { my $protocol = $Apache::lonnet::protocol{$home}; $protocol = 'http' if ($protocol ne 'https'); - return $protocol.'://'.$home; + return $protocol.'://'.&Apache::lonnet::hostname($home); } return; }