version 1.495, 2009/05/28 11:31:03
|
version 1.501, 2009/11/30 21:17:41
|
Line 111 use Apache::loncacc();
|
Line 111 use Apache::loncacc();
|
use Apache::lonmaxima(); |
use Apache::lonmaxima(); |
use Apache::lonr(); |
use Apache::lonr(); |
use Apache::lonlocal; |
use Apache::lonlocal; |
|
use Apache::lonhtmlcommon(); |
|
|
#==================================== Main subroutine: xmlparse |
#==================================== Main subroutine: xmlparse |
|
|
Line 757 sub init_safespace {
|
Line 758 sub init_safespace {
|
'&maxima_cas_formula_fix'); |
'&maxima_cas_formula_fix'); |
|
|
$safehole->wrap(\&Apache::lonr::r_eval,$safeeval,'&r_eval'); |
$safehole->wrap(\&Apache::lonr::r_eval,$safeeval,'&r_eval'); |
|
$safehole->wrap(\&Apache::lonr::Rentry,$safeeval,'&Rentry'); |
|
$safehole->wrap(\&Apache::lonr::Rarray,$safeeval,'&Rarray'); |
$safehole->wrap(\&Apache::lonr::r_check,$safeeval,'&r_check'); |
$safehole->wrap(\&Apache::lonr::r_check,$safeeval,'&r_check'); |
$safehole->wrap(\&Apache::lonr::r_cas_formula_fix,$safeeval, |
$safehole->wrap(\&Apache::lonr::r_cas_formula_fix,$safeeval, |
'&r_cas_formula_fix'); |
'&r_cas_formula_fix'); |
Line 1041 sub get_id {
|
Line 1044 sub get_id {
|
my ($parstack,$safeeval)=@_; |
my ($parstack,$safeeval)=@_; |
my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); |
my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); |
if ($env{'request.state'} eq 'construct' && $id =~ /([._]|[^\w\d\s[:punct:]])/) { |
if ($env{'request.state'} eq 'construct' && $id =~ /([._]|[^\w\d\s[:punct:]])/) { |
&error(&mt("ID "[_1]" contains invalid characters, IDs are only allowed to contain letters, numbers, spaces and -",'<tt>'.$id.'</tt>')); |
&error(&mt('ID [_1] contains invalid characters. IDs are only allowed to contain letters, numbers, spaces and -','"<tt>'.$id.'</tt>"')); |
} |
} |
if ($id =~ /^\s*$/) { $id = $Apache::lonxml::curdepth; } |
if ($id =~ /^\s*$/) { $id = $Apache::lonxml::curdepth; } |
return $id; |
return $id; |
Line 1544 sub renderingoptions {
|
Line 1547 sub renderingoptions {
|
= &Apache::loncommon::plainlanguagedescription($_); |
= &Apache::loncommon::plainlanguagedescription($_); |
} |
} |
} |
} |
return |
my $output; |
'<span class="LC_nobreak">'. |
unless ($env{'form.forceedit'}) { |
&mt('Language:').' '. |
$output .= ' |
&Apache::loncommon::select_form($env{'form.languages'},'languages', |
<span class="LC_nobreak">'. |
%langchoices).' |
&mt('Language:').' '. |
</span> |
&Apache::loncommon::select_form($env{'form.languages'},'languages', |
|
%langchoices).' |
|
</span>'; |
|
} |
|
$output .= ' |
<span class="LC_nobreak">'. |
<span class="LC_nobreak">'. |
&mt('Math Rendering:').' '. |
&mt('Math Rendering:').' '. |
&Apache::loncommon::select_form($env{'form.texengine'},'texengine', |
&Apache::loncommon::select_form($env{'form.texengine'},'texengine', |
Line 1558 sub renderingoptions {
|
Line 1565 sub renderingoptions {
|
'jsMath' => 'jsMath', |
'jsMath' => 'jsMath', |
'mimetex' => 'mimetex (Convert to Images)')).' |
'mimetex' => 'mimetex (Convert to Images)')).' |
</span>'; |
</span>'; |
|
return $output; |
} |
} |
|
|
sub inserteditinfo { |
sub inserteditinfo { |
Line 1618 FULLPAGE
|
Line 1626 FULLPAGE
|
} |
} |
|
|
my $titledisplay=&display_title(); |
my $titledisplay=&display_title(); |
|
my $wysiwyglink; |
my %lt=&Apache::lonlocal::texthash('st' => 'Save and Edit', |
my %lt=&Apache::lonlocal::texthash('st' => 'Save and Edit', |
'vi' => 'Save and View', |
'vi' => 'Save and View', |
'dv' => 'Discard Edits and View', |
'dv' => 'Discard Edits and View', |
Line 1632 FULLPAGE
|
Line 1641 FULLPAGE
|
if ($htmlerror) { |
if ($htmlerror) { |
$htmlerror='<span class="LC_error">'.$htmlerror.'</span>'; |
$htmlerror='<span class="LC_error">'.$htmlerror.'</span>'; |
} |
} |
|
if (&Apache::lonhtmlcommon::htmlareabrowser()) { |
|
if (&Apache::lonhtmlcommon::htmlareablocked()) { |
|
$wysiwyglink = &Apache::lonhtmlcommon::enablelink($textarea_id); |
|
} else { |
|
$wysiwyglink = &Apache::lonhtmlcommon::disablelink($textarea_id); |
|
} |
|
} |
} |
} |
my $editfooter=(<<ENDFOOTER); |
my $editfooter=(<<ENDFOOTER); |
$initialize |
$initialize |
Line 1656 $initialize
|
Line 1672 $initialize
|
</div> |
</div> |
<textarea $textarea_events style="width:100%" cols="80" rows="44" name="filecont" id="filecont">$filecontents</textarea> |
<textarea $textarea_events style="width:100%" cols="80" rows="44" name="filecont" id="filecont">$filecontents</textarea> |
<div id="LC_aftertextarea"> |
<div id="LC_aftertextarea"> |
|
$wysiwyglink |
<br /> |
<br /> |
$titledisplay |
$titledisplay |
</div> |
</div> |
Line 1704 sub handler {
|
Line 1721 sub handler {
|
$request->set_last_modified(&Apache::lonnet::metadata($request->uri, |
$request->set_last_modified(&Apache::lonnet::metadata($request->uri, |
'lastrevisiondate')); |
'lastrevisiondate')); |
} |
} |
|
# Embedded Flash movies from Camtasia served from https will not display in IE |
|
# if XML config file has expired from cache. |
|
if ($ENV{'SERVER_PORT'} == 443) { |
|
if ($request->uri =~ /\.xml$/) { |
|
my ($httpbrowser,$clientbrowser) = |
|
&Apache::loncommon::decode_user_agent($request); |
|
if ($clientbrowser =~ /^explorer$/i) { |
|
delete $request->headers_out->{'Cache-control'}; |
|
delete $request->headers_out->{'Pragma'}; |
|
my $expiration = time + 60; |
|
my $date=strftime("%a, %d %b %Y %H:%M:%S GMT",gmtime($expiration)); |
|
$request->headers_out->set("Expires" => $date); |
|
} |
|
} |
|
} |
$request->send_http_header; |
$request->send_http_header; |
|
|
return OK if $request->header_only; |
return OK if $request->header_only; |
Line 1798 ENDNOTFOUND
|
Line 1830 ENDNOTFOUND
|
if ($env{'environment.remote'} eq 'off') { |
if ($env{'environment.remote'} eq 'off') { |
my $brcrum; |
my $brcrum; |
if ($env{'request.state'} eq 'construct') { |
if ($env{'request.state'} eq 'construct') { |
$brcrum = [{'href' => '', # FIXME Add link to /priv/[user] |
$brcrum = [{'href' => &Apache::loncommon::authorspace(), |
'text' => 'Construction Space'}, |
'text' => 'Construction Space'}, |
{'href' => '', |
{'href' => '', |
'text' => 'Editor'}]; |
'text' => 'Editor'}]; |
Line 1835 ENDNOTFOUND
|
Line 1867 ENDNOTFOUND
|
('add_entries' => |
('add_entries' => |
{'onresize' => $add_to_onresize, |
{'onresize' => $add_to_onresize, |
'onload' => $add_to_onload, }); |
'onload' => $add_to_onload, }); |
|
my $header; |
$options{'bread_crumbs'} = [{ |
if ($env{'request.state'} eq 'construct') { |
'href' => '', # FIXME Add link to /priv/[user] |
$options{'bread_crumbs'} = [{ |
'text' => 'Construction Space'}, |
'href' => &Apache::loncommon::authorspace(), |
{'href' => '', |
'text' => 'Construction Space'}, |
'text' => 'HTML Editor'}]; |
{'href' => '', |
|
'text' => 'HTML Editor'}]; |
|
$header = &Apache::loncommon::head_subbox( |
|
&Apache::loncommon::CSTR_pageheader()); |
|
} |
if ($env{'environment.remote'} ne 'off') { |
if ($env{'environment.remote'} ne 'off') { |
$options{'bgcolor'} = '#FFFFFF'; |
$options{'bgcolor'} = '#FFFFFF'; |
$options{'only_body'} = 1; |
$options{'only_body'} = 1; |
Line 1852 ENDNOTFOUND
|
Line 1887 ENDNOTFOUND
|
my $start_page = &Apache::loncommon::start_page(undef,$js, |
my $start_page = &Apache::loncommon::start_page(undef,$js, |
\%options); |
\%options); |
$result = $start_page |
$result = $start_page |
.&Apache::loncommon::head_subbox( |
.$header |
&Apache::loncommon::CSTR_pageheader()) |
|
.&Apache::lonxml::message_location() |
.&Apache::lonxml::message_location() |
.$edit_info |
.$edit_info |
.&Apache::loncommon::end_page(); |
.&Apache::loncommon::end_page(); |
} |
} |
} |
} |
if ($filetype eq 'html') { &writeallows($request->uri); } |
if ($filetype eq 'html') { &writeallows($request->uri); } |
|
|
&Apache::lonxml::add_messages(\$result); |
&Apache::lonxml::add_messages(\$result); |
$request->print($result); |
$request->print($result); |
|
|