- # $Apache::londefdef::table[-1]{'output'} .= $header_of_table.$Apache::londefdef::table[-1]{'hinc'}.$output.'\end{tabular}\strut\newline\strut ';
- $Apache::londefdef::table[-1]{'output'} .= $header_of_table.$Apache::londefdef::table[-1]{'hinc'}.$output.'\end{tabular}\strut'.'\\\\'."\n".'\strut ';
- if ($#Apache::londefdef::table > 0) {
- my $inmemory = $Apache::londefdef::table[-1]{'output'};
- # Figure out max/and min width by summing us and then
- # apply that to the current column of the table we nest in
- # if it's larger than the current width or the current width
- # is undefined.
- #
- my $min_nested_width = 0;
- my $max_nested_width = 0;
- for (my $col = 0; $col <= $Apache::londefdef::table[-1]{'counter_columns'}; $col++) {
- $min_nested_width += $min_len[$col];
- $max_nested_width += $max_len[$col];
-
- }
- # Fudge in an extra 5 mm for borders etc:
-
- $min_nested_width += 5;
- $max_nested_width += 5;
-
- my $outer_column = $Apache::londefdef::table[-2]{'counter_columns'};
- my $outer_row = $Apache::londefdef::table[-2]{'row_number'};
- if ($min_nested_width > $Apache::londefdef::table[-2]{'minlen'}[$outer_row][$outer_column]) {
- $Apache::londefdef::table[-2]{'minlen'}[$outer_row][$outer_column] = $min_nested_width;
- }
- if ($max_nested_width > $Apache::londefdef::table[-2]{'maxlen'}[$outer_row][$outer_column]) {
- $Apache::londefdef::table[-2]{'maxlen'}[$outer_row][$outer_column] = $max_nested_width;
- }
-
- pop @Apache::londefdef::table;
- push @{$Apache::londefdef::table[-1]{'include'}}, $inmemory;
- } else {
- $currentstring .= $Apache::londefdef::table[-1]{'output'};
- pop @Apache::londefdef::table;
- undef @Apache::londefdef::table;
- }
- }
- &enable_para();
- }
+
}
return $currentstring;
}
@@ -2722,17 +2326,26 @@ sub tag_check {
#
sub cell_config_hash {
- my ($align, $rowspan, $colspan) = @_;
+ my ($align, $rowspan, $colspan, $width) = @_;
+ if ($rowspan ne '') {
+ $rowspan =~ s/^\s+|\s+$//g;
+ }
+ if ($colspan ne '') {
+ $colspan =~ s/^\s+|\s+$//g;
+ }
my %config;
if ($align ne '') {
$config{'halign'} = $align;
}
- if ($colspan ne "") {
+ if (($colspan =~ /^\d+$/) && ($colspan > 0)) {
$config{'colspan'} = $colspan;
}
- if ($rowspan ne '') {
+ if (($rowspan =~ /^\d+$/) && ($rowspan > 0)) {
$config{'rowspan'} = $rowspan;
}
+ if ($width ne '') {
+ $config{'width'} = $width;
+ }
return \%config;
}
@@ -2744,11 +2357,11 @@ sub start_td_tex {
# attributes, but empty of text. end_td_tex will
# fetch the contents from the recursive parse and
# fill the cell with them:
- my $align = &Apache::lonxml::get_param('align', $parstack, $safeeval, undef, 1);
- my $rowspan = &Apache::lonxml::get_param('rowspan', $parstack, $safeeval, undef, 1);
- my $colspan = &Apache::lonxml::get_param('colspan', $parstack, $safeeval, undef, 1);
-
- my $config = &cell_config_hash($align, $rowspan, $colspan);
+ my $align = &Apache::lonxml::get_param('align', $parstack, $safeeval);
+ my $rowspan = &Apache::lonxml::get_param('rowspan', $parstack, $safeeval);
+ my $colspan = &Apache::lonxml::get_param('colspan', $parstack, $safeeval);
+ my $width = &Apache::lonxml::get_param('TeXwidth', $parstack, $safeeval);
+ my $config = &cell_config_hash($align, $rowspan, $colspan, $width);
my $table = $Apache::londefdef::table[-1];
$table->add_cell('', $config);
@@ -3264,21 +2877,28 @@ sub start_img {
['','bottom','middle','top','left','right'],$token,5);
$currentstring .=&Apache::edit::select_arg('TeXwrap:', 'TeXwrap',
['', 'none','parbox', 'parpic', 'wrapfigure'], $token, 2);
+ my $alt= &Apache::lonxml::get_param('alt',$parstack,$safeeval);
+ my $enc= &Apache::lonxml::get_param('encrypturl',$parstack,$safeeval);
+
$currentstring .=&Apache::edit::select_arg('Encrypt URL:','encrypturl',
['no','yes'], $token, 2);
+ if (($alt=~/\S/) && (lc($enc) eq 'yes')) {
+ $currentstring.='
'.&mt('Warning: the description "[_1]" will be available, even for encrypted URL',$alt).'';
+ }
$currentstring .=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
my $src= &Apache::lonxml::get_param('src',$parstack,$safeeval);
- my $alt= &Apache::lonxml::get_param('alt',$parstack,$safeeval);
my $width= &Apache::lonxml::get_param('width',$parstack,$safeeval);
my $height= &Apache::lonxml::get_param('height',$parstack,$safeeval);
if ($token->[2]{'src'}=~/\$/) {
- $currentstring.='Variable image source';
- } else {
+ $currentstring.=&mt('Variable image source');
+ } elsif ($token->[2]{'src'}=~/\S/) {
$currentstring .= '
>/home/httpd/prtspool/$env{'user.name'}_$env{'user.domain'}_printout.dat");
- my $newsrc=$orig_src;
- $newsrc =~ s|(.*)/res/|/home/httpd/html/res/|;
- &Apache::lonxml::debug("queueing $newsrc for dynamic eps production.");
- print FILE ("$newsrc\n");
- close(FILE);
+ if (open(FILE,">>/home/httpd/prtspool/$env{'user.name'}_$env{'user.domain'}_printout.dat")) {
+ my $newsrc=$orig_src;
+ $newsrc =~ s|(.*)/res/|/home/httpd/html/res/|;
+ &Apache::lonxml::debug("queueing $newsrc for dynamic eps production.");
+ print FILE ("$newsrc\n");
+ close(FILE);
+ }
$src=~s|/home/httpd/html/res|/home/httpd/prtspool|;
$src=~s|/home/([^/]*)/public_html/|/home/httpd/prtspool/$1/|;
if ($sext ne "") { # Put the ext. back in to uniquify.
@@ -4636,8 +4256,10 @@ sub get_eps_image {
sub eps_generation {
my ($src,$file,$width_param) = @_;
my $filename = "/home/httpd/prtspool/$env{'user.name'}_$env{'user.domain'}_printout.dat";
- my $temp_file = Apache::File->new('>>'.$filename);
- print $temp_file "$src\n";
+ if (open(my $tmpfile,">>$filename")) {
+ print $tmpfile "$src\n";
+ close($tmpfile);
+ }
my $newsrc = $src;
$newsrc =~ s/(\.bmp|\.gif|\.jpg|\.jpeg)$/\.eps/i;
$newsrc=~s{/home/httpd/html/res}{};