--- loncom/xml/londefdef.pm 2003/03/18 15:32:15 1.122
+++ loncom/xml/londefdef.pm 2003/07/09 20:04:19 1.152
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Tags Default Definition Module
#
-# $Id: londefdef.pm,v 1.122 2003/03/18 15:32:15 albertel Exp $
+# $Id: londefdef.pm,v 1.152 2003/07/09 20:04:19 sakharuk Exp $
#
#
# Copyright Michigan State University Board of Trustees
@@ -46,7 +46,7 @@ package Apache::londefdef;
use Apache::lonnet();
use strict;
-use Apache::lonxml();
+use Apache::lonxml;
use Apache::File();
use Image::Magick;
use Apache::lonmenu();
@@ -54,7 +54,7 @@ use Apache::lonmeta();
BEGIN {
- &Apache::lonxml::register('Apache::londefdef',('a','abbr','acronym','accessrule','address','allow','applet','area','b','base','basefont','bgo','bgsound','big','blink','blockquote','blankspace','body','br','button','caption','center','cite','code','col','colgroup','dd','del','dfn','dir','div','dl','dt','em','embed','externallink','fieldset','font','form','frame','frameset','h1','h2','h3','h4','h5','h6','head','hr','html','i','iframe','img','input','ins','insert','isindex','kbd','keygen','label','layer','legend','li','link','m','map','marquee','menu','meta','multicol','nobr','noembed','noframes','nolayer','noscript','object','ol','optgroup','option','output','p','param','pre','q','s','samp','select','server','small','spacer','span','strike','strong','sub','sup','table','tbody','td','textarea','tfoot','th','thead','title','tr','tt','tthoption','u','ul','var','wbr'));
+ &Apache::lonxml::register('Apache::londefdef',('a','abbr','acronym','accessrule','address','allow','applet','area','b','base','basefont','bgo','bgsound','big','blink','blockquote','blankspace','body','br','button','caption','center','cite','code','col','colgroup','dd','del','dfn','dir','div','dl','dt','em','embed','externallink','fieldset','font','form','frame','frameset','h1','h2','h3','h4','h5','h6','head','hr','html','i','iframe','img','input','ins','insert','isindex','kbd','keygen','label','layer','legend','li','link','m','map','marquee','menu','meta','multicol','nobr','noembed','noframes','nolayer','noscript','object','ol','optgroup','option','output','p','param','pre','q','s','samp','select','server','small','spacer','span','strike','strong','sub','sup','table','tbody','td','textarea','tfoot','th','thead','title','tr','tt','tthoption','u','ul','var','wbr','hideweboutput'));
}
@@ -157,9 +157,11 @@ sub start_html {
&Apache::lonxml::fontsettings();
} elsif ($target eq 'tex') {
@Apache::londefdef::table = ();
- $currentstring .= '\documentclass[letterpaper]{article}
- \newcommand{\keephidden}[1]{}
+ $currentstring .= '\documentclass[letterpaper]{article}'.
+ #'\batchmode'.
+ '\newcommand{\keephidden}[1]{}
\renewcommand{\deg}{$^{\circ}$}
+ \usepackage{longtable}
\usepackage{textcomp}
\usepackage[dvips]{graphicx}
\usepackage{epsfig}\usepackage{calc}
@@ -354,8 +356,7 @@ sub start_meta {
} else {
$currentstring = $token->[4];
}
- }
- if ($target eq 'meta') {
+ } elsif ($target eq 'meta') {
unless (&Apache::lonxml::get_param
('http-equiv',$parstack,$safeeval,undef,1)) {
my $name=$token->[2]->{'name'};
@@ -366,9 +367,15 @@ sub start_meta {
$currentstring='<'.$name.'>'.
&Apache::lonxml::get_param
('content',$parstack,$safeeval,undef,1).
- ''.$name.'>';
+ ''.$name.'>';
}
}
+ } elsif ($target eq 'tex') {
+ my $content=&Apache::lonxml::get_param('content',$parstack,$safeeval);
+ my $name=&Apache::lonxml::get_param('name',$parstack,$safeeval);
+ if ((not defined $content) && (not defined $name)) {
+ &Apache::lonxml::startredirection();
+ }
}
return $currentstring;
}
@@ -382,7 +389,10 @@ sub end_meta {
if ($args ne '') {
$currentstring = $token->[4];
}
- }
+ } elsif ($target eq 'tex') {
+ $currentstring=&Apache::lonxml::endredirection();
+ $currentstring='';
+ }
return $currentstring;
}
@@ -394,10 +404,15 @@ sub start_accessrule {
('effect',$parstack,$safeeval,undef,1);
my $realm=&Apache::lonxml::get_param
('realm',$parstack,$safeeval,undef,1);
- my $cont=&Apache::lonxml::get_param
- ('content',$parstack,$safeeval,undef,1);
- $cont=~s/\s+//g;
- $cont=~s/\W/\;/g;
+ my $role=&Apache::lonxml::get_param
+ ('role',$parstack,$safeeval,undef,1);
+ $realm=~s/\s+//g;
+ $realm=~s/\//\_/g;
+ $realm=~s/^\_//;
+ $realm=~s/\W/\;/g;
+ $role=~s/\s+//g;
+ $role=~s/\//\_/g;
+ $role=~s/\W/\;/g;
if ($target eq 'web') {
my $args='';
if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; }
@@ -408,7 +423,7 @@ sub start_accessrule {
}
}
if ($target eq 'meta') {
- $currentstring='