version 1.92, 2002/10/08 20:09:17
|
version 1.99, 2002/11/07 19:33:52
|
Line 845 EDITBUTTON
|
Line 845 EDITBUTTON
|
$currentstring .= $token->[4]; |
$currentstring .= $token->[4]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
if ($$tagstack[-2] ne 'sub' && $$tagstack[-2] ne 'sup') { |
if ($$tagstack[-2] ne 'sub' && $$tagstack[-2] ne 'sup') { |
$currentstring .= '\vskip 0 mm'; |
$currentstring .= '\vskip 0.2 mm'; |
} |
} |
} elsif ($target eq 'latexsource') { |
} elsif ($target eq 'latexsource') { |
$currentstring .= '\\'; |
$currentstring .= '\\'; |
Line 1412 sub start_table {
|
Line 1412 sub start_table {
|
if ($signature) { |
if ($signature) { |
my $NumberEmptyLength = $how_many_columns - $filled_columns; |
my $NumberEmptyLength = $how_many_columns - $filled_columns; |
my $SpacePerColumn = '(\textwidth '.$available_space.')/'.$NumberEmptyLength; |
my $SpacePerColumn = '(\textwidth '.$available_space.')/'.$NumberEmptyLength; |
$output =~ s/\$SpacePerColumn/$SpacePerColumn/g; |
my $shorthand = ($NumberEmptyLength+1)*4; |
|
$output =~ s/\$SpacePerColumn/$SpacePerColumn - $shorthand mm/g; |
} |
} |
$Apache::londefdef::table[-1]{'output'} .= $header_of_table.$output.$Apache::londefdef::table[-1]{'hinc'}.'\end{tabular}\vskip 0 mm '; |
$Apache::londefdef::table[-1]{'output'} .= $header_of_table.$output.$Apache::londefdef::table[-1]{'hinc'}.'\end{tabular}\vskip 0 mm '; |
if ($#Apache::londefdef::table > 0) { |
if ($#Apache::londefdef::table > 0) { |
Line 1542 sub start_table {
|
Line 1543 sub start_table {
|
#-- <img> tag |
#-- <img> tag |
sub start_img { |
sub start_img { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
$Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]= |
my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval, |
$token->[2]->{'src'}; |
undef,1); |
|
$Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]=$src; |
my $currentstring = ''; |
my $currentstring = ''; |
my $width_param = ''; |
my $width_param = ''; |
my $height_param = ''; |
my $height_param = ''; |
my $scaling = .3; |
my $scaling = .3; |
|
|
if ($target eq 'web') { |
if ($target eq 'web') { |
$currentstring = $token->[4]; |
$currentstring = $token->[4]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval); |
&image_replication($src); |
$src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src); |
$src=&Apache::lonnet::filelocation($Apache::lonxml::pwd[-1],$src); |
#if original gif/jpg file exist do following: |
#if original gif/jpg file exist do following: |
if (-e $src) { |
if (-e $src) { |
Line 1590 sub start_table {
|
Line 1592 sub start_table {
|
if (-e $newsrc) { |
if (-e $newsrc) { |
#eps counterpart for image exist |
#eps counterpart for image exist |
if ($path) { |
if ($path) { |
$currentstring .= '\noindent\graphicspath{{'.$path.'}}\fbox{\includegraphics[width='.$width_param.' mm]{'.$file.'}} '; |
$currentstring .= '\vskip 1 mm \noindent\graphicspath{{'.$path.'}}\fbox{\includegraphics[width='.$width_param.' mm]{'.$file.'}} '; |
} |
} |
} else { |
} else { |
#there is no eps counterpart for image - check for ps one |
#there is no eps counterpart for image - check for ps one |
Line 1599 sub start_table {
|
Line 1601 sub start_table {
|
#ps counterpart for image exist |
#ps counterpart for image exist |
$file =~ s/\.eps$/\.ps/; |
$file =~ s/\.eps$/\.ps/; |
if ($path) { |
if ($path) { |
$currentstring .= '\noindent\graphicspath{{'.$path.'}}\fbox{\includegraphics[width='.$width_param.' mm]{'.$file.'}} '; |
$currentstring .= '\vskip 1 mm \noindent\graphicspath{{'.$path.'}}\fbox{\includegraphics[width='.$width_param.' mm]{'.$file.'}} '; |
} |
} |
} else { |
} else { |
#there aren't eps or ps - so create eps |
#there aren't eps or ps - so create eps |
Line 1607 sub start_table {
|
Line 1609 sub start_table {
|
my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout.dat"; |
my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout.dat"; |
$temp_file = Apache::File->new('>>'.$filename); |
$temp_file = Apache::File->new('>>'.$filename); |
print $temp_file "$src\n"; |
print $temp_file "$src\n"; |
$currentstring .= '\graphicspath{{/home/httpd/prtspool/}}\fbox{\includegraphics[width='.$width_param.' mm]{'.$file.'}} '; |
$currentstring .= '\vskip 1 mm \graphicspath{{/home/httpd/prtspool/}}\fbox{\includegraphics[width='.$width_param.' mm]{'.$file.'}} '; |
} |
} |
} |
} |
} else { |
} else { |
Line 1713 sub start_embed {
|
Line 1715 sub start_embed {
|
return $currentstring; |
return $currentstring; |
} |
} |
#-- <allow> tag |
#-- <allow> tag |
sub start_allow { |
sub start_allow { |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
$Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]= |
$Apache::lonxml::extlinks[$#Apache::lonxml::extlinks+1]= |
$token->[2]->{'src'}; |
$token->[2]->{'src'}; |
my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval); |
my $src = &Apache::lonxml::get_param('src',$parstack,$safeeval); |
if (not -e '/home/httpd/html'.$src) { |
&image_replication($src); |
#replicates image itself |
my $result; |
&Apache::lonnet::repcopy('/home/httpd/html'.$src); |
if ($target eq 'edit') { |
#replicates eps or ps |
$result .=&Apache::edit::tag_start($target,$token); |
my $newsrc = $src; |
$result .=&Apache::edit::text_arg('File Spec:','src',$token,70); |
$newsrc =~ s/(.gif|.jpg)$/.eps/; |
$result .=&Apache::edit::end_row();#.&Apache::edit::start_spanning_row(); |
if (not-e $newsrc && &Apache::lonnet::repcopy('/home/httpd/html'.$newsrc) ne 'OK') { |
} elsif ($target eq 'modified') { |
$newsrc =~ s/\.ps$/\.eps/; |
my $constructtag=&Apache::edit::get_new_args($token,$parstack, |
&Apache::lonnet::repcopy('/home/httpd/html'.$newsrc); |
$safeeval,'src'); |
} |
if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); } |
} |
} |
return ''; |
return $result; |
} |
} |
sub end_allow { |
|
return ''; |
sub end_allow { |
} |
my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; |
|
if ( $target eq 'edit') { return (&Apache::edit::end_table()); } |
|
return ''; |
|
} |
#-- Frames |
#-- Frames |
sub start_frameset { |
sub start_frameset { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
Line 2527 sub start_embed {
|
Line 2532 sub start_embed {
|
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
|
|
|
sub image_replication { |
|
my $src = shift; |
|
if (not -e '/home/httpd/html'.$src) { |
|
#replicates image itself |
|
&Apache::lonnet::repcopy('/home/httpd/html'.$src); |
|
#replicates eps or ps |
|
my $newsrc = $src; |
|
$newsrc =~ s/(.gif|.jpg)$/.eps/; |
|
if (not-e $newsrc && &Apache::lonnet::repcopy('/home/httpd/html'.$newsrc) ne 'OK') { |
|
$newsrc =~ s/\.ps$/\.eps/; |
|
&Apache::lonnet::repcopy('/home/httpd/html'.$newsrc); |
|
} |
|
} |
|
return ''; |
|
} |
|
|
1; |
1; |
__END__ |
__END__ |