version 1.403.4.2, 2010/08/20 21:20:24
|
version 1.407, 2009/05/26 14:54:29
|
Line 538 sub start_body {
|
Line 538 sub start_body {
|
|
|
my $extra_head = &generate_css_links(); |
my $extra_head = &generate_css_links(); |
|
|
|
# Breadcrumbs |
|
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
|
&Apache::lonhtmlcommon::add_breadcrumb({ |
|
'text' => 'Construction Space', |
|
'href' => '', # FIXME Add link to /priv/[user] |
|
}); |
|
&Apache::lonhtmlcommon::add_breadcrumb({ |
|
'text' => 'HTML Editor', |
|
'href' => '', |
|
}); |
|
|
$currentstring = |
$currentstring = |
&Apache::loncommon::start_page($Apache::londefdef::title, |
&Apache::loncommon::start_page($Apache::londefdef::title, |
$Apache::londefdef::head |
$Apache::londefdef::head |
.$extra_head, |
.$extra_head, |
{'add_entries' => $token->[2], |
{'add_entries' => $token->[2], |
'no_title' => 1, |
# 'no_title' => 1, |
'force_register' => 1}); |
'force_register' => 1}); |
|
|
if ($env{'request.state'} ne 'published') { |
$currentstring .= &Apache::lonhtmlcommon::breadcrumbs(); |
$currentstring.=&Apache::lonmenu::constspaceform(); |
|
$currentstring.=&Apache::londefdef::edit_controls(); |
my $header = ''; |
} |
if ($env{'request.state'} ne 'published') { |
$currentstring.=&Apache::lonxml::message_location(); |
$header=&Apache::lonmenu::constspaceform() |
|
.&Apache::londefdef::edit_controls(); |
|
} |
|
$currentstring.=&Apache::loncommon::head_subbox( |
|
&Apache::loncommon::CSTR_pageheader() |
|
.$header); |
|
$currentstring.=&Apache::lonxml::message_location(); |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
$currentstring = ''; # '\begin{document}' is in header. |
$currentstring = ''; # '\begin{document}' is in header. |
} |
} |
|
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
Line 1349 sub start_font {
|
Line 1367 sub start_font {
|
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web' || $target eq 'webgrade') { |
if ($target eq 'web' || $target eq 'webgrade') { |
my $face=&Apache::lonxml::get_param('face',$parstack,$safeeval); |
my $face=&Apache::lonxml::get_param('face',$parstack,$safeeval); |
if ($face!~/symbol/i) { |
|
if (($env{'browser.fontenhance'} eq 'on') || |
|
($env{'browser.blackwhite'} eq 'on')) { return ''; } |
|
} |
|
$currentstring = $token->[4]; |
$currentstring = $token->[4]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
my $fontsize=&Apache::lonxml::get_param('TeXsize',$parstack,$safeeval); |
my $fontsize=&Apache::lonxml::get_param('TeXsize',$parstack,$safeeval); |
Line 2018 sub start_table {
|
Line 2032 sub start_table {
|
my $width = &Apache::lonxml::get_param('TeXwidth', $parstack, $safeeval, undef, 0); |
my $width = &Apache::lonxml::get_param('TeXwidth', $parstack, $safeeval, undef, 0); |
my $theme = &Apache::lonxml::get_param('TeXtheme', $parstack, $safeeval, undef, 0); |
my $theme = &Apache::lonxml::get_param('TeXtheme', $parstack, $safeeval, undef, 0); |
my $align = &Apache::lonxml::get_param('align', $parstack, $safeeval, undef, 0); |
my $align = &Apache::lonxml::get_param('align', $parstack, $safeeval, undef, 0); |
my $cell_border = &Apache::lonxml::get_param('rules', $parstack, $safeeval, undef, 0); |
|
|
|
# The only thing that needs any figuring out is the width.. and then only if it is |
# The only thing that needs any figuring out is the width.. and then only if it is |
# a percent. If not it's assumed to be some valid TeX measurement unit e.g. 3.0cm |
# a percent. If not it's assumed to be some valid TeX measurement unit e.g. 3.0cm |
# |
# |
|
|
my $table = new Apache::lontable(); |
my $table = new Apache::lontable(); |
if ((defined $border) && ($border > 0)) { |
if ($border ne '') { |
# &Apache::lonnet::logthis("Turning on table borders: $border"); |
$table->table_border(1); |
$table->table_border(1); |
$table->cell_border(1); |
if ($cell_border ne 'none') { |
} |
$table->cell_border(1); # html specs that border turns on both...unless rules='none'. |
if ($theme ne '') { |
} |
|
} |
|
# Only all or nothing for cell borders for now: |
|
|
|
if ((defined $cell_border) && ($cell_border ne 'none')) { |
|
# &Apache::lonnet::logthis("Turning on cell borders: $cell_border"); |
|
$table->cell_border(1); |
|
} |
|
if (defined $theme) { |
|
$table->theme($theme); |
$table->theme($theme); |
} |
} |
if (defined $align) { |
if ($align ne '') { |
$table->alignment($align); |
$table->alignment($align); |
} |
} |
|
|
# Missing width is most of page width |
# Missing width is most of page width |
|
|
if (!(defined $width)) { |
if ($width eq "") { |
$width = '70%'; |
$width = '70%'; |
} |
} |
|
|
# If a percentage, need to calculate what this means in terms of |
# If a percentage, need to calculate what this means in terms of |
# page width: |
# page width: |
|
|
Line 3255 sub start_img {
|
Line 3259 sub start_img {
|
['','bottom','middle','top','left','right'],$token,5); |
['','bottom','middle','top','left','right'],$token,5); |
$currentstring .=&Apache::edit::select_arg('TeXwrap:', 'TeXwrap', |
$currentstring .=&Apache::edit::select_arg('TeXwrap:', 'TeXwrap', |
['', 'none','parbox', 'parpic', 'wrapfigure'], $token, 2); |
['', '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', |
$currentstring .=&Apache::edit::select_arg('Encrypt URL:','encrypturl', |
['no','yes'], $token, 2); |
['no','yes'], $token, 2); |
if (($alt=~/\S/) && (lc($enc) eq 'yes')) { |
|
$currentstring.='<br /><span class="LC_warning">'.&mt('Warning: the description "[_1]" will be available, even for encrypted URL',$alt).'</span><br />'; |
|
} |
|
$currentstring .=&Apache::edit::end_row().&Apache::edit::start_spanning_row(); |
$currentstring .=&Apache::edit::end_row().&Apache::edit::start_spanning_row(); |
my $src= &Apache::lonxml::get_param('src',$parstack,$safeeval); |
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 $width= &Apache::lonxml::get_param('width',$parstack,$safeeval); |
my $height= &Apache::lonxml::get_param('height',$parstack,$safeeval); |
my $height= &Apache::lonxml::get_param('height',$parstack,$safeeval); |
|
|
if ($token->[2]{'src'}=~/\$/) { |
if ($token->[2]{'src'}=~/\$/) { |
$currentstring.=&mt('Variable image source'); |
$currentstring.='Variable image source'; |
} elsif ($token->[2]{'src'}=~/\S/) { |
} else { |
$currentstring .= '<img src="'.$src.'" alt="'.$alt.'" '; |
$currentstring .= '<img src="'.$src.'" alt="'.$alt.'" '; |
if ($width) { $currentstring.=' width="'.$width.'" '; } |
if ($width) { $currentstring.=' width="'.$width.'" '; } |
if ($height) { $currentstring.=' height="'.$height.'" '; } |
if ($height) { $currentstring.=' height="'.$height.'" '; } |
$currentstring .= ' />'; |
$currentstring .= ' />'; |
} else { |
|
$currentstring.=&mt("No image source specified"); |
|
} |
} |
} elsif ($target eq 'modified') { |
} elsif ($target eq 'modified') { |
my ($osrc,$owidth,$oheight)= |
my ($osrc,$owidth,$oheight)= |
Line 3525 sub start_frameset {
|
Line 3522 sub start_frameset {
|
&Apache::loncommon::start_page($Apache::londefdef::title, |
&Apache::loncommon::start_page($Apache::londefdef::title, |
$Apache::londefdef::head, |
$Apache::londefdef::head, |
{'add_entries' => $token->[2], |
{'add_entries' => $token->[2], |
'no_title' => 1, |
# 'no_title' => 1, |
'force_register' => 1, |
'force_register' => 1, |
'frameset' => 1,}); |
'frameset' => 1,}); |
|
|
Line 4738 sub align_latex_image {
|
Line 4735 sub align_latex_image {
|
# Even though we set a default alignment value, the user |
# Even though we set a default alignment value, the user |
# could have given us an illegal value. In that case we |
# could have given us an illegal value. In that case we |
# just use the default alignment of bottom.. |
# just use the default alignment of bottom.. |
$currentstring = ''; |
$currentstring = "\n% figurewrapping \n"; |
if ($align eq "top") { |
if ($align eq "top") { |
$currentstring .= '\raisebox{-'.$height.'mm}{'.$image; |
$currentstring .= '\raisebox{-'.$height.'mm}{'.$image; |
$closure = '}'; |
$closure = '}'; |
Line 4781 sub align_latex_image {
|
Line 4778 sub align_latex_image {
|
$currentstring .= "{$image"; |
$currentstring .= "{$image"; |
$closure = '}'; |
$closure = '}'; |
} |
} |
|
$currentstring .= "\n% end wrappage\n"; |
|
$closure = "\n% Begin closure\n".$closure."\n% End closure\n"; |
return ($currentstring, $closure); |
return ($currentstring, $closure); |
} |
} |
|
|
Line 4800 sub is_inside_of {
|
Line 4799 sub is_inside_of {
|
# |
# |
# This sub provides the typical LaTeX prefix matter for tex output: |
# This sub provides the typical LaTeX prefix matter for tex output: |
# |
# |
sub latex_header { |
sub latex_header |
|
{ |
my ($mode) = @_; |
my ($mode) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
|
|