--- loncom/xml/lonxml.pm 2000/11/14 22:24:38 1.38
+++ loncom/xml/lonxml.pm 2001/05/04 17:33:35 1.70
@@ -3,14 +3,77 @@
#
# last modified 06/26/00 by Alexander Sakharuk
# 11/6 Gerd Kortemeyer
+# 6/1/1 Gerd Kortemeyer
+# 2/21,3/13 Guy
+# 3/29,5/4 Gerd Kortemeyer
package Apache::lonxml;
use vars
-qw(@pwd $outputstack $redirection $textredirection $on_offimport @extlinks);
+qw(@pwd @outputstack $redirection $import @extlinks $metamode);
use strict;
use HTML::TokeParser;
use Safe;
+use Safe::Hole;
use Opcode;
+use Apache::Constants qw(:common);
+
+
+sub xmlbegin {
+ my $output='';
+ if ($ENV{'browser.mathml'}) {
+ $output=''
+ .''
+ .']>'
+ .'';
+ } else {
+ $output='';
+ }
+ return $output;
+}
+
+sub xmlend {
+ return '';
+}
+
+sub fontsettings() {
+ my $headerstring='';
+ if (($ENV{'browser.os'} eq 'mac') && (!$ENV{'browser.mathml'})) {
+ $headerstring.=
+ '';
+ }
+ return $headerstring;
+}
+
+sub registerurl {
+ return (<
+ function LONCAPAreg() {
+ if (window.location.pathname!="/res/adm/pages/menu.html") {
+ menu=window.open("","LONCAPAmenu");
+ menu.currentURL=window.location.pathname;
+ menu.currentStale=0;
+ }
+ }
+
+ function LONCAPAstale() {
+ if (window.location.pathname!="/res/adm/pages/menu.html") {
+ menu=window.open("","LONCAPAmenu");
+ menu.currentStale=1;
+ }
+ }
+
+ENDSCRIPT
+}
+
+sub loadevents() {
+ return 'LONCAPAreg();';
+}
+
+sub unloadevents() {
+ return 'LONCAPAstale();';
+}
sub register {
my $space;
@@ -21,27 +84,45 @@ sub register {
$Apache::lonxml::alltags{$temptag}=$space;
}
}
-
+
+sub printalltags {
+ my $temp;
+ foreach $temp (sort keys %Apache::lonxml::alltags) {
+ &Apache::lonxml::debug("$temp -- $Apache::lonxml::alltags{$temp}");
+ }
+}
use Apache::style;
-use Apache::lontexconvert;
use Apache::run;
use Apache::londefdef;
use Apache::scripttag;
+use Apache::edit;
#================================================== Main subroutine: xmlparse
@pwd=();
-$outputstack = '';
-$redirection = 1;
-$textredirection = 1;
-$on_offimport = 0;
+@outputstack = ();
+$redirection = 0;
+$import = 1;
@extlinks=();
+$metamode = 0;
sub xmlparse {
my ($target,$content_file_string,$safeinit,%style_for_target) = @_;
- if ($target eq 'meta')
- {$Apache::lonxml::textredirection = 0;
- $Apache::lonxml::on_offimport = 1;
+ if ($target eq 'meta') {
+ # meta mode is a bit weird only some output is to be turned off
+ #