--- loncom/xml/lonxml.pm 2003/09/15 19:56:44 1.278
+++ loncom/xml/lonxml.pm 2003/09/27 04:08:56 1.281
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# XML Parser Module
#
-# $Id: lonxml.pm,v 1.278 2003/09/15 19:56:44 www Exp $
+# $Id: lonxml.pm,v 1.281 2003/09/27 04:08:56 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -105,6 +105,7 @@ use Apache::loncommon();
use Apache::lonfeedback();
use Apache::lonmsg();
use Apache::loncacc();
+use Apache::lonlocal;
#================================================== Main subroutine: xmlparse
#debugging control, to turn on debugging modify the correct handler
@@ -159,6 +160,9 @@ $Apache::lonxml::usestyle=1;
$Apache::lonxml::style_values='';
$Apache::lonxml::style_end_values='';
+#array of ssi calls that need to occur after we are done parsing
+@Apache::lonxml::ssi_info=();
+
sub xmlbegin {
my $output='';
if ($ENV{'browser.mathml'}) {
@@ -352,6 +356,7 @@ sub xmlparse {
if ($ENV{'request.uri'}) {
&writeallows($ENV{'request.uri'});
}
+ &do_registered_ssi();
if ($Apache::lonxml::counter_changed) { &store_counter() }
return $finaloutput;
}
@@ -491,9 +496,9 @@ sub inner_xmlparse {
}
# Encode any high ASCII characters
- if (!$Apache::lonxml::prevent_entity_encode) {
- $result=&HTML::Entities::encode($result,"\200-\377");
- }
+# if (!$Apache::lonxml::prevent_entity_encode) {
+# $result=&HTML::Entities::encode($result,"\200-\377");
+# }
if ($Apache::lonxml::redirection) {
$Apache::lonxml::outputstack['-1'] .= $result;
} else {
@@ -602,6 +607,7 @@ sub setup_globals {
&init_counter();
@Apache::lonxml::pwd=();
@Apache::lonxml::extlinks=();
+ @Apache::lonxml::ssi_info=();
if ($target eq 'meta') {
$Apache::lonxml::redirection = 0;
$Apache::lonxml::metamode = 1;
@@ -792,7 +798,7 @@ sub decreasedepth {
$Apache::lonxml::olddepth=$Apache::lonxml::depth+1;
}
if ( $Apache::lonxml::depth < -1) {
- &Apache::lonxml::warning("Missing tags, unable to properly run file.");
+ &Apache::lonxml::warning(&mt("Missing tags, unable to properly run file."));
$Apache::lonxml::depth='-1';
}
my $curdepth=join('_',@Apache::lonxml::depthcounter);
@@ -997,6 +1003,19 @@ sub writeallows {
&Apache::lonnet::appenv(%httpref);
}
+sub register_ssi {
+ my ($url,%form)=@_;
+ push (@Apache::lonxml::ssi_info,{'url'=>$url,'form'=>\%form});
+ return '';
+}
+
+sub do_registered_ssi {
+ foreach my $info (@Apache::lonxml::ssi_info) {
+ my %form=%{ $info->{'form'}};
+ my $url=$info->{'url'};
+ &Apache::lonnet::ssi($url,%form);
+ }
+}
#
# Afterburner handles anchors, highlights and links
#
@@ -1087,21 +1106,24 @@ sub inserteditinfo {
}
my $cleanbut = '';
if ($filetype eq 'html') {
- $cleanbut='';
+ $cleanbut='';
}
my $titledisplay=&display_title();
+ my %lt=&Apache::lonlocal::texthash('st' => 'Save this',
+ 'vi' => 'View',
+ 'ed' => 'Edit');
my $buttons=(<