--- loncom/xml/londefdef.pm 2007/07/13 18:35:20 1.373 +++ loncom/xml/londefdef.pm 2008/02/14 22:37:46 1.381 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.373 2007/07/13 18:35:20 albertel Exp $ +# $Id: londefdef.pm,v 1.381 2008/02/14 22:37:46 www Exp $ # # # Copyright Michigan State University Board of Trustees @@ -448,6 +448,16 @@ sub start_meta { if ((not defined $content) && (not defined $name)) { &Apache::lonxml::startredirection(); } + } elsif ($target eq 'edit') { + $currentstring .= &Apache::edit::tag_start($target,$token); + $currentstring .= &Apache::edit::text_arg('Name:','name',$token,30); + $currentstring .= &Apache::edit::text_arg('Content:','content',$token,70); + $currentstring .= &Apache::edit::end_row(); + } elsif ($target eq 'modified') { + my $constructtag = + &Apache::edit::get_new_args($token,$parstack,$safeeval, + 'name','content'); + if ($constructtag) { $currentstring = &Apache::edit::rebuild_tag($token); } } return $currentstring; } @@ -471,6 +481,11 @@ sub end_meta { return $currentstring; } +sub insert_meta { + return ' + '; +} + # accessrule sub start_accessrule { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style) = @_; @@ -564,12 +579,7 @@ sub start_body { if ($env{'request.state'} ne 'published') { $currentstring.=&Apache::lonmenu::constspaceform(); - $currentstring.=(< - - -
-EDITBUTTON + $currentstring.=&Apache::londefdef::edit_controls(); } $currentstring.=&Apache::lonxml::message_location(); } elsif ($target eq 'tex') { @@ -578,6 +588,16 @@ EDITBUTTON return $currentstring; } +sub edit_controls { + my $result .= (< + + +
+EDITBUTTON + return $result; +} + sub end_body { my ($target,$token,$tagstack,$parstack,$parser,$safeeval) = @_; my $currentstring = &end_p(); # Close off unclosed

@@ -1253,9 +1273,7 @@ sub start_br { $signal = 1; } } - if ($signal eq 1) { - $currentstring .= ' \vskip 0 mm '; - } else { + if ($signal != 1) { $currentstring .= '\strut \\\\ \strut '; } @@ -1567,6 +1585,9 @@ sub start_div { } if ($target eq 'tex') { # 4 possible alignments: left, right, center, and -missing-. + # If inside a table row, we must let the table logic + # do the alignment, however. + # my $endstring = ''; @@ -1577,6 +1598,7 @@ sub start_div { $endstring = '\end{center}'; if (&is_inside_of($tagstack, "table")) { $currentstring = ¢er_correction().$currentstring; + $endstring .= ¢er_end_correction(); } } elsif ($align eq 'right') { @@ -3041,11 +3063,14 @@ sub start_img { my $width= &Apache::lonxml::get_param('width',$parstack,$safeeval); my $height= &Apache::lonxml::get_param('height',$parstack,$safeeval); - - $currentstring .= ''.$alt.'[2]{'src'}=~/\$/) { + $currentstring.='Variable image source'; + } else { + $currentstring .= ''.$alt.'[2]{'src'},$token->[2]{'width'},$token->[2]{'height'}); @@ -4525,6 +4550,12 @@ sub align_latex_image { my ($align, $latex_rendering, $image, $width, $height) = @_; my $currentstring; # The 1/2 wrapped image. my $closure; # The closure of the wrappage. + + # if it's none just return it back + if ($latex_rendering eq 'none') { + return ($image,''); + } + # If there's an alignment specification we need to honor it here. # For the horizontal alignments, we will also honor the # value of the latex specfication. The default is parbox,