--- loncom/xml/lonxml.pm 2002/06/03 21:07:20 1.176 +++ loncom/xml/lonxml.pm 2002/06/15 18:59:26 1.178 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.176 2002/06/03 21:07:20 www Exp $ +# $Id: lonxml.pm,v 1.178 2002/06/15 18:59:26 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -524,6 +524,23 @@ sub xmlparse { my ($request,$target,$content_file_string,$safeinit,%style_for_target) = @_; &setup_globals($request,$target); +# +# do we have a course style file? +# + + if ($ENV{'request.course.id'}) { + my $bodytext= + $ENV{'course.'.$ENV{'request.course.id'}.'.default_xml_style'}; + if ($bodytext) { + my $location=&Apache::lonnet::filelocation('',$bodytext); + my $styletext=&Apache::lonnet::getfile($location); + if ($styletext ne '-1') { + %style_for_target = (%style_for_target, + &Apache::style::styleparser($target,$styletext)); + } + } + } + #&printalltags(); my @pars = (); my $pwd=$ENV{'request.filename'}; @@ -1240,7 +1257,10 @@ ENDNOTFOUND # unless ($ENV{'request.state'} eq 'published') { if ($ENV{'form.editmode'} && (!($ENV{'form.viewmode'}))) { - $result=''; + my $displayfile=$request->uri; + $displayfile=~s/^\/[^\/]*//; + $result='

'.$displayfile. + '

'; $result=&inserteditinfo($result,$filecontents); } }