--- loncom/xml/londefdef.pm 2006/04/18 20:45:40 1.327 +++ loncom/xml/londefdef.pm 2006/09/05 21:57:57 1.336 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.327 2006/04/18 20:45:40 albertel Exp $ +# $Id: londefdef.pm,v 1.336 2006/09/05 21:57:57 foxr Exp $ # # # Copyright Michigan State University Board of Trustees @@ -180,11 +180,11 @@ sub end_tthoption { sub start_html { my ($target,$token) = @_; my $currentstring = ''; - &Apache::lontexconvert::init_tth(); if ($target eq 'web' || $target eq 'edit' || $target eq 'webgrade' ) { # start_body() takes care of emitting the } elsif ($target eq 'tex') { - $currentstring .= '\documentclass[letterpaper,twoside]{article}'; + $currentstring .= + '\documentclass[letterpaper,twoside]{article}\raggedbottom'; if (($env{'form.latex_type'}=~'batchmode') || (!$env{'request.role.adv'})) {$currentstring .='\batchmode';} $currentstring .= '\newcommand{\keephidden}[1]{}'. @@ -534,6 +534,7 @@ sub start_body { 'force_register' => 1}); if ($env{'request.state'} ne 'published') { + $currentstring.=&Apache::lonmenu::constspaceform(); $currentstring.=(< @@ -1153,7 +1154,7 @@ sub start_p { $currentstring .= &end_p(); # close off prior para if in progress. my $align=&Apache::lonxml::get_param('align',$parstack,$safeeval,undef,1); if ($align eq 'center') { - $currentstring .='\begin{center}\par'; + $currentstring .='\begin{center}\par '; $closing_string = '\end{center}'; if (&is_inside_of($tagstack, "table")) { $currentstring = ¢er_correction().$currentstring; @@ -1209,13 +1210,14 @@ sub start_br { # for (my $i=$#tempo;$i>=0;$i--) { if (($tempo[$i] eq 'b') || ($tempo[$i] eq 'strong') || - ($tempo[$i] eq 'ol') || ($tempo[$i] eq 'ul') || - ($tempo[$i] eq 'td') || ($tempo[$i] eq 'th')) { + ($tempo[$i] eq 'ol') || ($tempo[$i] eq 'ul')) { $signal=1; - last; + } + if (($tempo[$i] eq 'td') || ($tempo[$i] eq 'th')) { + $signal = 1; } } - if ($signal) { + if ($signal eq 1) { $currentstring .= ' \vskip 0 mm '; } elsif ($$tagstack[-2] ne 'sub' && $$tagstack[-2] ne 'sup') { $currentstring .= '\strut \\\\ \strut '; @@ -2198,9 +2200,13 @@ sub end_table { # if ($colspan > 1) { + my $spanwidth = 0; + for (my $spancol = $jn; $spancol < $jn + $colspan; $spancol++) { + $spanwidth += $fwidth[$spancol]; + } $output .= '\multicolumn{'. $colspan - .'}{|l|}{'; + ."}{|p{$spanwidth mm}|}{"; } if ($rowspan > 1) { @@ -2866,7 +2872,7 @@ sub start_img { ['','bottom','middle','top','left','right'],$token,5); $currentstring .=&Apache::edit::select_arg('TeXwrap:', 'TeXwrap', ['', 'parbox', 'parpic'], $token, 2); - $currentstring .=&Apache::edit::select_arg('Encyrpt URL:','encrypturl', + $currentstring .=&Apache::edit::select_arg('Encrypt URL:','encrypturl', ['no','yes'], $token, 2); $currentstring .=&Apache::edit::end_row().&Apache::edit::start_spanning_row(); my $src= &Apache::lonxml::get_param('src',$parstack,$safeeval); @@ -3088,34 +3094,14 @@ sub start_frameset { my ($target,$token) = @_; my $currentstring = ''; # Close any pending para. if ($target eq 'web' || $target eq 'webgrade') { - if (!$Apache::lonxml::registered && - $env{'request.state'} eq 'published') { - $currentstring.=''. - &Apache::lonmenu::registerurl(undef,$target).''; - } - my $onLoad=''; - foreach my $key (keys(%{$token->[2]})) { - if ($key =~ /^onload$/i) { - $onLoad.=$token->[2]->{$key}.';'; - delete($token->[2]->{$key}); - } - } - $token->[2]->{'onload'}=&Apache::lonmenu::loadevents().';'.$onLoad; - my $onUnload=''; - foreach my $key (keys(%{$token->[2]})) { - if ($key =~ /^onunload$/i) { - $onUnload.=$token->[2]->{$key}.';'; - delete($token->[2]->{$key}); - } - } - $token->[2]->{'onunload'}=&Apache::lonmenu::unloadevents(). - ';'.$onUnload; - - $currentstring .= '<'.$token->[1]; - foreach (keys %{$token->[2]}) { - $currentstring.=' '.$_.'="'.$token->[2]->{$_}.'"'; - } - $currentstring.='>'; + $currentstring = + &Apache::loncommon::start_page($Apache::londefdef::title, + $Apache::londefdef::head, + {'add_entries' => $token->[2], + 'no_title' => 1, + 'force_register' => 1, + 'frameset' => 1,}); + } return $currentstring; }