[LON-CAPA-cvs] cvs: loncom /xml lonxml.pm
www
lon-capa-cvs@mail.lon-capa.org
Sat, 15 Jun 2002 18:59:26 -0000
www Sat Jun 15 14:59:26 2002 EDT
Modified files:
/loncom/xml lonxml.pm
Log:
Bug 532
Expand style_for_target hash by default style file at beginning of xmlparse
call.
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.177 loncom/xml/lonxml.pm:1.178
--- loncom/xml/lonxml.pm:1.177 Fri Jun 14 15:56:57 2002
+++ loncom/xml/lonxml.pm Sat Jun 15 14:59:26 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.177 2002/06/14 19:56:57 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 @@
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'};