--- loncom/interface/lonsyllabus.pm 2009/12/22 06:31:02 1.104
+++ loncom/interface/lonsyllabus.pm 2010/03/03 21:33:15 1.107
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Syllabus
#
-# $Id: lonsyllabus.pm,v 1.104 2009/12/22 06:31:02 faziophi Exp $
+# $Id: lonsyllabus.pm,v 1.107 2010/03/03 21:33:15 droeschl Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -52,13 +52,13 @@ 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'},['forcestudent','register','forceedit']);
# ----------------------------------------------------- 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;
- &Apache::loncommon::simple_error_page($r,'No syllabus available',
+ &Apache::loncommon::simple_error_page($r,'No syllabus available',
'No syllabus available');
return OK;
}
@@ -74,14 +74,8 @@ sub handler {
my $externalsyllabus=$courseenv{'externalsyllabus'};
if ($externalsyllabus=~/\w/) {
-
- if ($env{'form.wrapperdisplay'} eq 'menu') {
- $r->print(&Apache::lonwrapper::simple_menu());
- } else {
- $r->print(&Apache::lonwrapper::wrapper("/public/$cdom/$cnum/syllabus?wrapperdisplay=menu",
- $externalsyllabus));
- }
- return OK;
+ $r->print( Apache::lonwrapper::wrapper($externalsyllabus) );
+ return OK;
}
# ------------------------------ The buck stops here: internal syllabus display
@@ -383,84 +377,53 @@ ENDSCRIPT
'');
}
my @htmlids=();
+ my $url_include_handler = sub {
+ my ($r, $field, $message, $group, $data_ref, $fields_ref, $target, $allowed) = @_;
+ my %data = %{$data_ref};
+ my %fields = %{$fields_ref};
+ my $urls=$message;
+ $message='';
+ foreach my $filelink (split(/\n/,$urls)) {
+ my $output='';
+ # embed style?
+ my ($curfext)=($filelink=~/\.([^\.]+)$/);
+ my $embstyle=&Apache::loncommon::fileembstyle($curfext);
+ if (($embstyle eq 'ssi') || ($curfext=~/\/$/)) {# make ssi call and remove everything but the body contents
+ $output=&Apache::lonnet::ssi_body($filelink);
+ } elsif ($embstyle eq 'img') {# embed as an image
+ $output='';
+ }
+ if ($output ne '') {
+ if ($target ne 'tex') {
+ $message.='
'.$output.'
'; + } else { + $message.=' '.&Apache::lonxml::xmlparse($r,'tex',''.$output.'
').' '; + } + } + } + if ($allowed) { + &Apache::lonfeedback::newline_to_br(\$urls); + &Apache::lontemplate::print_start_template($r,$fields{$field}. + &Apache::loncommon::help_open_topic('Syllabus_URLs'),'LC_Box'); + $r->print($urls); + $r->print("'.$output.'
'; - } else { - $message.=' '.&Apache::lonxml::xmlparse($r,'tex',''.$output.'
').' '; - } - } - } - if ($allowed) { - &Apache::lonfeedback::newline_to_br(\$urls); - &Apache::lontemplate::print_start_template($r,$syllabusfields{$field}. - &Apache::loncommon::help_open_topic('Syllabus_URLs'),'LC_Box'); - $r->print($urls); - $r->print("');} else {$r->print('\par ');} $r->print(&mt('No syllabus information provided.'));