--- loncom/xml/londefdef.pm 2003/02/05 23:17:32 1.111
+++ loncom/xml/londefdef.pm 2003/03/18 07:26:49 1.121
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Tags Default Definition Module
#
-# $Id: londefdef.pm,v 1.111 2003/02/05 23:17:32 albertel Exp $
+# $Id: londefdef.pm,v 1.121 2003/03/18 07:26:49 www Exp $
#
#
# Copyright Michigan State University Board of Trustees
@@ -44,15 +44,17 @@
package Apache::londefdef;
-use Apache::lonnet;
+use Apache::lonnet();
use strict;
-use Apache::lonxml;
+use Apache::lonxml();
use Apache::File();
use Image::Magick;
+use Apache::lonmenu();
+use Apache::lonmeta();
BEGIN {
- &Apache::lonxml::register('Apache::londefdef',('a','abbr','acronym','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'));
}
@@ -121,6 +123,7 @@ sub start_tthoption {
&tth::tthoptions($inside);
}
}
+ return $result;
}
sub end_tthoption {
@@ -154,11 +157,12 @@ sub start_html {
} elsif ($target eq 'tex') {
@Apache::londefdef::table = ();
$currentstring .= '\documentclass[letterpaper]{article}
- \newcommand{\keephidden}[1]{}
- \renewcommand{\deg}{$^{\circ}$}
- \usepackage[dvips]{graphicx}
- \usepackage{epsfig}\usepackage{calc}
- \newenvironment{choicelist}{\begin{enumerate}}{\end{enumerate}}';
+ \newcommand{\keephidden}[1]{}
+ \renewcommand{\deg}{$^{\circ}$}
+ \usepackage{textcomp}
+ \usepackage[dvips]{graphicx}
+ \usepackage{epsfig}\usepackage{calc}
+\newenvironment{choicelist}{\begin{list}{}{\setlength{\rightmargin}{0in}\setlength{\leftmargin}{0.13in}\setlength{\topsep}{0.05in}\setlength{\itemsep}{0.022in}\setlength{\parsep}{0in}\setlength{\belowdisplayskip}{0.04in}\setlength{\abovedisplayskip}{0.05in}\setlength{\abovedisplayshortskip}{-0.04in}\setlength{\belowdisplayshortskip}{0.04in}}}{\end{list}}';
}
return $currentstring;
}
@@ -183,7 +187,7 @@ sub start_html {
my ($target,$token) = @_;
my $currentstring = '';
if ($target eq 'web') {
- $currentstring = &Apache::lonxml::registerurl(undef,$target).
+ $currentstring = &Apache::lonmenu::registerurl(undef,$target).
$token->[2];
}
return $currentstring;
@@ -321,25 +325,28 @@ sub start_html {
}
#-- tag
sub start_meta {
- my ($target,$token,$tagstack,$parstack,$parser) = @_;
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
my $currentstring = '';
if ($target eq 'web') {
my $args='';
if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; }
if ($args eq '') {
- &Apache::lonxml::get_all_text("/meta",$$parser[$#$parser]);
+ &Apache::lonxml::get_all_text("/meta",$parser);
} else {
$currentstring = $token->[4];
}
}
if ($target eq 'meta') {
- unless ($token->[2]->{'http-equiv'}) {
+ unless (&Apache::lonxml::get_param
+ ('http-equiv',$parstack,$safeeval,undef,1)) {
my $name=$token->[2]->{'name'};
$name=~tr/A-Z/a-z/;
- $name=~s/\s/\_/g;
+ $name=~s/\s/\_/gs;
+ $name=~s/\W//gs;
if ($name) {
$currentstring='<'.$name.'>'.
- $token->[2]->{'content'}.
+ &Apache::lonxml::get_param
+ ('content',$parstack,$safeeval,undef,1).
''.$name.'>';
}
}
@@ -358,6 +365,46 @@ sub start_html {
}
return $currentstring;
}
+# accessrule
+ sub start_accessrule {
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_;
+ my $currentstring = '';
+ my $eff=&Apache::lonxml::get_param
+ ('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;
+ if ($target eq 'web') {
+ my $args='';
+ if ( $#$parstack > -1 ) { $args=$$parstack[$#$parstack]; }
+ if ($args eq '') {
+ &Apache::lonxml::get_all_text("/accessrule",$parser);
+ } else {
+ $currentstring = $token->[4];
+ }
+ }
+ if ($target eq 'meta') {
+ $currentstring='