version 1.47, 2002/03/06 20:27:00
|
version 1.52, 2002/04/08 15:17:01
|
Line 50 use Apache::lonxml;
|
Line 50 use Apache::lonxml;
|
|
|
BEGIN { |
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','insert')); |
&Apache::lonxml::register('Apache::londefdef',('m','html','head','map','select','option','input','textarea','form','meta','title','body','center','b','strong','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','allow','frameset','pre','insert','externallink','table','tr','td')); |
|
|
} |
} |
|
|
Line 115 sub end_m {
|
Line 115 sub end_m {
|
&Apache::lonxml::fontsettings(); |
&Apache::lonxml::fontsettings(); |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring .= '\documentclass[letterpaper]{article} |
$currentstring .= '\documentclass[letterpaper]{article} |
\setlength{\oddsidemargin}{-40pt} |
|
\setlength{\evensidemargin}{-60pt} |
|
\setlength{\topmargin}{200pt} |
|
\setlength{\textwidth}{4.4in} |
|
\setlength{\textheight}{6.8in} |
|
\setlength{\parindent}{20pt} |
|
\setlength{\marginparwidth}{90pt} |
|
\setlength{\textfloatsep}{8pt plus 2.0pt minus 4.0pt} |
|
\newcommand{\keephidden}[1]{} |
\newcommand{\keephidden}[1]{} |
\usepackage[dvips]{graphicx} |
\usepackage[dvips]{graphicx} |
\usepackage{epsfig}'; |
\usepackage{epsfig}'; |
Line 361 sub end_m {
|
Line 353 sub end_m {
|
if ($ENV{'request.state'} ne 'published') { |
if ($ENV{'request.state'} ne 'published') { |
$currentstring.=(<<EDITBUTTON); |
$currentstring.=(<<EDITBUTTON); |
<form method="post"> |
<form method="post"> |
<input type="submit" name="showmode" value="Edit" /> |
<input type="submit" name="editmode" value="Edit" /> |
</form> |
</form> |
EDITBUTTON |
EDITBUTTON |
} |
} |
Line 1267 EDITBUTTON
|
Line 1259 EDITBUTTON
|
} |
} |
#-- <table> tag |
#-- <table> tag |
sub start_table { |
sub start_table { |
my ($target,$token) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring = $token->[4]; |
$currentstring = $token->[4]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring = ''; |
my $border = &Apache::lonxml::get_param('border',$parstack,$safeeval); |
|
unless (defined $border) { $border = 0; } |
|
if ($border) { |
|
$Apache::londefdef::table{'hinc'} = '\hline '; |
|
$Apache::londefdef::table{'vinc'} = '&'; |
|
$Apache::londefdef::table{'vvinc'} = '|'; |
|
} else { |
|
$Apache::londefdef::table{'hinc'} = ''; |
|
$Apache::londefdef::table{'vinc'} = ''; |
|
$Apache::londefdef::table{'vvinc'} = ''; |
|
} |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 1282 EDITBUTTON
|
Line 1284 EDITBUTTON
|
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring = $token->[2]; |
$currentstring = $token->[2]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring = ''; |
my $output = ''; |
} |
my $header_of_table = '{'.$Apache::londefdef::table{'vvinc'}; |
|
my $in; |
|
for ($in=0;$in<$Apache::londefdef::table{'counter_columns'};$in++) { |
|
$header_of_table .= @{ $Apache::londefdef::table{'columns'} }[$in].$Apache::londefdef::table{'vvinc'}; |
|
$output .= $Apache::londefdef::table{'rowdata'}[$in]; |
|
chop $output; |
|
$output .= ' \\\\ '; |
|
} |
|
$header_of_table .= '}'; |
|
$currentstring .= '\begin{tabular}'.$header_of_table.$output.$Apache::londefdef::table{'hinc'}.'\end{tabular}'; |
|
} |
return $currentstring; |
return $currentstring; |
} |
} |
#-- <tr> tag |
#-- <tr> tag |
sub start_tr { |
sub start_tr { |
my ($target,$token) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring = $token->[4]; |
$currentstring = $token->[4]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring = ''; |
if (substr(&Apache::lonxml::get_param('align',$parstack,$safeeval),0,1) ne '') { |
|
push @ {$Apache::londefdef::table{'rows'} }, substr(&Apache::lonxml::get_param('align',$parstack,$safeeval),0,1); |
|
} else { |
|
push @ {$Apache::londefdef::table{'rows'} }, 'c'; |
|
} |
|
push ( @{ $Apache::londefdef::table{'rowdata'} }, $Apache::londefdef::table{'hinc'}); |
|
$Apache::londefdef::table{'counter_columns'} = 0; |
|
|
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
sub end_tr { |
sub end_tr { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring = $token->[2]; |
$currentstring = $token->[2]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring = ''; |
} |
} |
|
return $currentstring; |
return $currentstring; |
} |
} |
#-- <td> tag |
#-- <td> tag |
sub start_td { |
sub start_td { |
my ($target,$token) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring = $token->[4]; |
$currentstring = $token->[4]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring = ''; |
my $what_to_push = substr(&Apache::lonxml::get_param('align',$parstack,$safeeval),0,1); |
|
if ($what_to_push eq '') { |
|
$what_to_push = substr($Apache::londefdef::table{'rows'}[0],0,1);; |
|
} |
|
push @{ $Apache::londefdef::table{'columns'} }, $what_to_push; |
|
$Apache::londefdef::table{'counter_columns'}++; |
|
&Apache::lonxml::startredirection(); |
|
; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
sub end_td { |
sub end_td { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring = $token->[2]; |
$currentstring = $token->[2]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring = ''; |
my $current_row = $#{ $Apache::londedef::table{'rows'} }; |
|
my $data=&Apache::lonxml::endredirection(); |
|
@{ $Apache::londefdef::table{'rowdata'} }[$current_row] .= $data.' '.$Apache::londefdef::table{'vinc'}; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 1358 EDITBUTTON
|
Line 1385 EDITBUTTON
|
} |
} |
$file=~s/(\.gif|\.jpg)$/\.eps/; |
$file=~s/(\.gif|\.jpg)$/\.eps/; |
if ($path) { |
if ($path) { |
$currentstring = '\graphicspath{{'.$path.'}}\fbox{\includegraphics{'.$file.'}}'; |
$currentstring = '\graphicspath{{'.$path.'/}}\fbox{\includegraphics{'.$file.'}}'; |
} else { |
} else { |
$currentstring = 'See the image at \tt{'.$src.'}'; |
$currentstring = 'See the image at \tt{'.$src.'}'; |
} |
} |
Line 1525 sub start_embed {
|
Line 1552 sub start_embed {
|
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web') { |
if ($target eq 'web') { |
|
$currentstring .= ''; |
|
} |
|
return $currentstring; |
|
} |
|
#-- <externallink> |
|
sub start_externallink { |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
|
my $currentstring = ''; |
|
if ($target eq 'web') { |
|
my $display = &Apache::lonxml::get_param('display',$parstack,$safeeval); |
|
$currentstring .= '<b>'.$display.'</b>';; |
|
} |
|
return $currentstring; |
|
} |
|
sub end_externallink { |
|
my ($target,$token) = @_; |
|
my $currentstring = ''; |
|
if ($target eq 'web') { |
$currentstring .= ''; |
$currentstring .= ''; |
} |
} |
return $currentstring; |
return $currentstring; |