version 1.405, 2009/05/15 18:06:20
|
version 1.417, 2010/06/10 15:54:06
|
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(); |
|
if ($env{'request.state'} eq 'construct') { |
|
&Apache::lonhtmlcommon::add_breadcrumb({ |
|
'text' => 'Construction Space', |
|
'href' => &Apache::loncommon::authorspace(), |
|
}); |
|
&Apache::lonhtmlcommon::add_breadcrumb({ |
|
'text' => 'HTML Editor', |
|
'href' => '', |
|
}); |
|
# breadcrumbs (and tools) will be created |
|
# in start_page->bodytag->innerregister |
|
} else { |
|
# FIXME Where are we? |
|
} |
|
|
$currentstring = |
$currentstring = |
&Apache::loncommon::start_page($Apache::londefdef::title, |
&Apache::loncommon::start_page($Apache::londefdef::title, |
$Apache::londefdef::head |
$Apache::londefdef::head |
Line 546 sub start_body {
|
Line 563 sub start_body {
|
# 'no_title' => 1, |
# 'no_title' => 1, |
'force_register' => 1}); |
'force_register' => 1}); |
|
|
if ($env{'request.state'} ne 'published') { |
my $header = ''; |
$currentstring.=&Apache::lonmenu::constspaceform(); |
if ($env{'request.state'} ne 'published' && |
$currentstring.=&Apache::londefdef::edit_controls(); |
$env{'request.state'} ne 'construct') { |
} |
$header=&Apache::lonmenu::constspaceform(); |
$currentstring.=&Apache::lonxml::message_location(); |
} |
|
if ($env{'request.state'} ne 'published') { |
|
$header.=&Apache::londefdef::edit_controls(); |
|
} |
|
if ($env{'request.state'} eq 'construct') { |
|
$currentstring.=&Apache::loncommon::head_subbox( |
|
&Apache::loncommon::CSTR_pageheader() |
|
.$header); |
|
} elsif ($env{'request.state'} eq 'edit') { |
|
$currentstring.=&Apache::loncommon::head_subbox($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 570 sub edit_controls {
|
Line 599 sub edit_controls {
|
</div>'; |
</div>'; |
} |
} |
$result .= ' |
$result .= ' |
<div class="LC_edit_problem_header_edit_row"><input type="submit" name="editmode" accesskey="e" value="'.&mt('Edit').'" /></div></div> |
<div><input type="submit" name="editmode" accesskey="e" value="'.&mt('Edit').'" />'; |
|
if (($env{'request.course.id'}) && ($env{'form.forceedit'})) { |
|
$result .= (' ' x 3).'<input type="button" value="'.&mt('Course View').'" onclick="javascript:location.href=currentURL" />'; |
|
} |
|
$result .= '</div> |
|
</div> |
</form> |
</form> |
<br />'; |
'; |
return $result; |
return $result; |
} |
} |
|
|
Line 3125 sub start_img {
|
Line 3159 sub start_img {
|
# Render unto browsers that which are the browser's... |
# Render unto browsers that which are the browser's... |
|
|
if ($target eq 'web' || $target eq 'webgrade') { |
if ($target eq 'web' || $target eq 'webgrade') { |
if ($env{'browser.imagesuppress'} ne 'on') { |
my $enc = ('yes' eq |
my $enc = ('yes' eq |
lc(&Apache::lonxml::get_param('encrypturl',$parstack, |
lc(&Apache::lonxml::get_param('encrypturl',$parstack, |
$safeeval))); |
$safeeval))); |
$currentstring.=&Apache::lonenc::encrypt_ref($token,{'src'=>$src}, |
$currentstring.=&Apache::lonenc::encrypt_ref($token,{'src'=>$src}, |
$enc); |
$enc); |
|
} else { |
|
my $alttag = &Apache::lonxml::get_param('alt',$parstack,$safeeval, |
|
undef,1); |
|
if (!$alttag) { |
|
$alttag = &Apache::lonmeta::alttag($Apache::lonxml::pwd[-1], |
|
$src); |
|
} |
|
$currentstring.='[IMAGE: '.$alttag.']'; |
|
} |
|
|
|
# and render unto TeX that which is LaTeX |
|
|
|
|
# and render unto TeX that which is LaTeX |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
# |
# |
# The alignment will require some superstructure to be put around |
# The alignment will require some superstructure to be put around |
Line 3324 sub start_applet {
|
Line 3347 sub start_applet {
|
&Apache::lonxml::extlink($archive); |
&Apache::lonxml::extlink($archive); |
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web' || $target eq 'webgrade') { |
if ($target eq 'web' || $target eq 'webgrade') { |
if ($env{'browser.appletsuppress'} ne 'on') { |
$currentstring = &Apache::lonenc::encrypt_ref($token, |
$currentstring = &Apache::lonenc::encrypt_ref($token, |
{'code'=>$code, |
{'code'=>$code, |
'archive'=>$archive} |
'archive'=>$archive} |
); |
); |
|
} else { |
|
my $alttag= &Apache::lonxml::get_param('alt',$parstack, |
|
$safeeval,undef,1); |
|
unless ($alttag) { |
|
$alttag=&Apache::lonmeta::alttag($Apache::lonxml::pwd[-1], |
|
$code); |
|
} |
|
$currentstring='[APPLET: '.$alttag.']'; |
|
} |
|
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
# Turn off some stuff we can't be inside thank you LaTeX |
# Turn off some stuff we can't be inside thank you LaTeX |
|
|
|
|
my $restart_sub = 0; |
my $restart_sub = 0; |
my $restart_sup = 0; |
my $restart_sup = 0; |
Line 3404 sub start_embed {
|
Line 3416 sub start_embed {
|
&Apache::lonxml::extlink($src); |
&Apache::lonxml::extlink($src); |
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web' || $target eq 'webgrade') { |
if ($target eq 'web' || $target eq 'webgrade') { |
if ($env{'browser.embedsuppress'} ne 'on') { |
$currentstring=&Apache::lonenc::encrypt_ref($token,{'src'=>$src}); |
$currentstring=&Apache::lonenc::encrypt_ref($token,{'src'=>$src}); |
|
} else { |
|
my $alttag=&Apache::lonxml::get_param |
|
('alt',$parstack,$safeeval,undef,1); |
|
unless ($alttag) { |
|
$alttag=&Apache::lonmeta::alttag($Apache::lonxml::pwd[-1],$src); |
|
} |
|
$currentstring='[EMBED: '.$alttag.']'; |
|
} |
|
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
} |
} |
return $currentstring; |
return $currentstring; |
Line 3423 sub end_embed {
|
Line 3426 sub end_embed {
|
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web' || $target eq 'webgrade') { |
if ($target eq 'web' || $target eq 'webgrade') { |
$currentstring = $token->[2]; |
$currentstring = $token->[2]; |
} elsif ($target eq 'tex') { |
} elsif ($target eq 'tex') { |
} |
# ./. |
|
} |
return $currentstring; |
return $currentstring; |
} |
} |
|
|
Line 3863 sub end_colgroup {
|
Line 3867 sub end_colgroup {
|
return $currentstring; |
return $currentstring; |
} |
} |
|
|
|
|
#-- <del> tag (end tag required) |
#-- <del> tag (end tag required) |
sub start_del { |
sub start_del { |
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web' || $target eq 'webgrade') { |
if ($target eq 'web' || $target eq 'webgrade') { |
$currentstring = $token->[4]; |
$currentstring = $token->[4]; |
|
} elsif ($target eq 'tex') { |
|
&disable_para(); |
|
$currentstring .= '\st{'; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 3877 sub end_del {
|
Line 3885 sub end_del {
|
my ($target,$token) = @_; |
my ($target,$token) = @_; |
my $currentstring = ''; |
my $currentstring = ''; |
if ($target eq 'web' || $target eq 'webgrade') { |
if ($target eq 'web' || $target eq 'webgrade') { |
$currentstring = $token->[2]; |
$currentstring = $token->[2]; |
|
} elsif ($target eq 'tex') { |
|
&enable_para(); |
|
$currentstring = '}'; |
} |
} |
return $currentstring; |
return $currentstring; |
} |
} |
Line 4717 sub align_latex_image {
|
Line 4728 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 = "\n% figurewrapping \n"; |
$currentstring = ''; |
if ($align eq "top") { |
if ($align eq "top") { |
$currentstring .= '\raisebox{-'.$height.'mm}{'.$image; |
$currentstring .= '\raisebox{-'.$height.'mm}{'.$image; |
$closure = '}'; |
$closure = '}'; |
Line 4760 sub align_latex_image {
|
Line 4771 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 4781 sub is_inside_of {
|
Line 4790 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 = ''; |
|
|
Line 4816 sub latex_header
|
Line 4824 sub latex_header
|
"\\usepackage{xcolor}\n". |
"\\usepackage{xcolor}\n". |
'\usepackage{calc}'. |
'\usepackage{calc}'. |
'\usepackage{amsmath}'. |
'\usepackage{amsmath}'. |
|
'\usepackage{soul}', |
'\usepackage{amssymb}'. |
'\usepackage{amssymb}'. |
'\usepackage{amsfonts}'. |
'\usepackage{amsfonts}'. |
'\usepackage{amsthm}'. |
'\usepackage{amsthm}'. |