--- loncom/xml/londefdef.pm 2002/02/21 04:29:27 1.43 +++ loncom/xml/londefdef.pm 2002/02/26 21:44:45 1.44 @@ -1,7 +1,8 @@ + # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.43 2002/02/21 04:29:27 albertel Exp $ +# $Id: londefdef.pm,v 1.44 2002/02/26 21:44:45 sakharuk Exp $ # # # Copyright Michigan State University Board of Trustees @@ -49,7 +50,7 @@ use Apache::lonxml; BEGIN { - &Apache::lonxml::register('Apache::londefdef',('m','html','head','map','select','option','input','textarea','form','meta','title','body','center','b','strong','table','dt','h1','h2','h3','h4','h5','h6','cite','i','address','dd','dl','dir','ol','ul','menu','dfn','kbd','tt','code','em','q','p','br','big','small','basefont','font','s','sub','strike','sup','hr','a','li','u','output','param','applet','img','embed','tr','td','allow','frameset','pre')); + &Apache::lonxml::register('Apache::londefdef',('m','html','head','map','select','option','input','textarea','form','meta','title','body','center','b','strong','table','dt','h1','h2','h3','h4','h5','h6','cite','i','address','dd','dl','dir','ol','ul','menu','dfn','kbd','tt','code','em','q','p','br','big','small','basefont','font','s','sub','strike','sup','hr','a','li','u','output','param','applet','img','embed','tr','td','allow','frameset','pre','insert')); } @@ -123,7 +124,8 @@ sub end_m { \setlength{\marginparwidth}{90pt} \setlength{\textfloatsep}{8pt plus 2.0pt minus 4.0pt} \newcommand{\keephidden}[1]{} - \usepackage[dvips]{graphicx}'; + \usepackage[dvips]{graphicx} + \usepackage{epsfig}'; } return $currentstring; } @@ -1309,7 +1311,7 @@ EDITBUTTON my ($target,$token) = @_; my $currentstring = ''; if ($target eq 'web') { - $currentstring = $token->[4]; + $currentstring = $token->[4]; } elsif ($target eq 'tex') { $currentstring = ''; } @@ -1319,21 +1321,30 @@ EDITBUTTON my ($target,$token) = @_; my $currentstring = ''; if ($target eq 'web') { - $currentstring = $token->[2]; + $currentstring = $token->[2]; } elsif ($target eq 'tex') { - $currentstring = ''; - } + $currentstring = ''; + } return $currentstring; } #-- tag sub start_img { my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; - $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]= + $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]= $token->[2]->{'src'}; my $currentstring = ''; + if ($target eq 'web') { $currentstring = $token->[4]; } elsif ($target eq 'tex') { +#<<<<<<< londefdef.pm +# my $durty = $token->[2]->{'src'}; +# $durty =~ s!(^.*)/(.*)$!$1/!; +# my $durtytwo = $2; +# $currentstring = '\graphicspath{{/home/httpd/html'.$durty.'}}\fbox{\includegraphics{'.$durtytwo.'}}'; +# } +# return $currentstring; +#======= my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval); my $file; my $path; @@ -1360,15 +1371,16 @@ EDITBUTTON } } return $currentstring; +#>>>>>>> 1.43 } sub end_img { my ($target,$token) = @_; my $currentstring = ''; if ($target eq 'web') { - $currentstring = $token->[2]; + $currentstring = $token->[2]; } elsif ($target eq 'tex') { - $currentstring = ''; - } + $currentstring = ''; + } return $currentstring; } #-- tag @@ -1377,41 +1389,42 @@ EDITBUTTON my ($target,$token) = @_; $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]= $token->[2]->{'code'}; - $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]= + $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]= $token->[2]->{'archive'}; my $currentstring = ''; if ($target eq 'web') { - $currentstring = $token->[4]; - } elsif ($target eq 'tex') { - $currentstring = " \\begin{figure} "; - } - return $currentstring; - } - sub end_applet { - my ($target,$token) = @_; - my $currentstring = ''; - if ($target eq 'web') { - $currentstring = $token->[2]; + $currentstring = $token->[4]; } elsif ($target eq 'tex') { - $currentstring = " \\end{figure}"; + $currentstring = " \\begin{figure} "; } return $currentstring; } +sub end_applet { + my ($target,$token) = @_; + my $currentstring = ''; + if ($target eq 'web') { + $currentstring = $token->[2]; + } elsif ($target eq 'tex') { + $currentstring = " \\end{figure}"; + } + return $currentstring; +} #-- tag - sub start_embed { - my ($target,$token) = @_; - $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]= - $token->[2]->{'src'}; - my $currentstring = ''; - if ($target eq 'web') { - $currentstring = $token->[4]; - } elsif ($target eq 'tex') { - $currentstring = " \\begin{figure} "; - } - return $currentstring; - } +sub start_embed { + + my ($target,$token) = @_; + $Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]= + $token->[2]->{'src'}; + my $currentstring = ''; + if ($target eq 'web') { + $currentstring = $token->[4]; + } elsif ($target eq 'tex') { + $currentstring = " \\begin{figure} "; + } + return $currentstring; +} sub end_embed { my ($target,$token) = @_; my $currentstring = ''; @@ -1506,5 +1519,22 @@ EDITBUTTON } return $currentstring; } +#-- + sub start_insert { + my ($target,$token) = @_; + my $currentstring = ''; + if ($target eq 'web') { + $currentstring .= ''.$token->[2]->{'display'}.'';; + } + return $currentstring; + } + sub end_insert { + my ($target,$token) = @_; + my $currentstring = ''; + if ($target eq 'web') { + $currentstring .= ''; + } + return $currentstring; + } 1; __END__