version 1.494.4.5, 2010/10/01 14:21:55
|
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 243 sub tokeninputfield {
|
Line 244 sub tokeninputfield {
|
document.tokeninput.barcode.value=''; |
document.tokeninput.barcode.value=''; |
} |
} |
</script> |
</script> |
<form method="post" name="tokeninput" action=""> |
<form method="post" name="tokeninput"> |
<table border="2" bgcolor="#FFFFBB"> |
<table border="2" bgcolor="#FFFFBB"> |
<tr><th>DocID Checkin</th></tr> |
<tr><th>DocID Checkin</th></tr> |
<tr><td> |
<tr><td> |
Line 251 sub tokeninputfield {
|
Line 252 sub tokeninputfield {
|
<tr> |
<tr> |
<td>Scan in Barcode</td> |
<td>Scan in Barcode</td> |
<td><input type="text" size="22" name="barcode" |
<td><input type="text" size="22" name="barcode" |
onchange="updatetoken()"/></td> |
onChange="updatetoken()"/></td> |
</tr> |
</tr> |
<tr><td><i>or</i> Type in DocID</td> |
<tr><td><i>or</i> Type in DocID</td> |
<td> |
<td> |
Line 260 onchange="updatetoken()"/></td>
|
Line 261 onchange="updatetoken()"/></td>
|
<input type="text" size="5" name="codetwo" /> |
<input type="text" size="5" name="codetwo" /> |
<b><font size="+2">*</font></b> |
<b><font size="+2">*</font></b> |
<input type="text" size="10" name="codethree" value="$defhost" |
<input type="text" size="10" name="codethree" value="$defhost" |
onchange="this.value=this.value.toUpperCase()" /> |
onChange="this.value=this.value.toUpperCase()" /> |
</td></tr> |
</td></tr> |
</table> |
</table> |
</td></tr> |
</td></tr> |
Line 1043 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 1523 SIMPLECONTENT
|
Line 1524 SIMPLECONTENT
|
|
|
sub verify_html { |
sub verify_html { |
my ($filecontents)=@_; |
my ($filecontents)=@_; |
my ($is_html,$is_xml); |
if ($filecontents!~/(?:\<|\<\;)(?:html|xml)[^\<]*(?:\>|\>\;)/is) { |
if ($filecontents =~/(?:\<|\<\;)\?xml[^\<]*\?(?:\>|\>\;)/is) { |
return &mt('File does not have [_1] or [_2] starting tag','<html>','<xml>'); |
$is_xml = 1; |
} |
} elsif ($filecontents =~/(?:\<|\<\;)html(?:\s+[^\<]+|\s*)(?:\>|\>\;)/is) { |
if ($filecontents!~/(?:\<|\<\;)\/(?:html|xml)(?:\>|\>\;)/is) { |
$is_html = 1; |
return &mt('File does not have [_1] or [_2] ending tag','<html>','<xml>'); |
} |
} |
unless ($is_xml || $is_html) { |
if ($filecontents!~/(?:\<|\<\;)(?:body|frameset)[^\<]*(?:\>|\>\;)/is) { |
return &mt('File does not have [_1] or [_2] starting tag','<html>','<?xml ?>'); |
return &mt('File does not have [_1] or [_2] starting tag','<body>','<frameset>'); |
} |
} |
if ($is_html) { |
if ($filecontents!~/(?:\<|\<\;)\/(?:body|frameset)[^\<]*(?:\>|\>\;)/is) { |
if ($filecontents!~/(?:\<|\<\;)\/html(?:\>|\>\;)/is) { |
return &mt('File does not have [_1] or [_2] ending tag','<body>','<frameset>'); |
return &mt('File does not have [_1] ending tag','<html>'); |
|
} |
|
if ($filecontents!~/(?:\<|\<\;)(?:body|frameset)[^\<]*(?:\>|\>\;)/is) { |
|
return &mt('File does not have [_1] or [_2] starting tag','<body>','<frameset>'); |
|
} |
|
if ($filecontents!~/(?:\<|\<\;)\/(?:body|frameset)[^\<]*(?:\>|\>\;)/is) { |
|
return &mt('File does not have [_1] or [_2] ending tag','<body>','<frameset>'); |
|
} |
|
} |
} |
return ''; |
return ''; |
} |
} |
Line 1556 sub renderingoptions {
|
Line 1549 sub renderingoptions {
|
} |
} |
my $output; |
my $output; |
unless ($env{'form.forceedit'}) { |
unless ($env{'form.forceedit'}) { |
$output .= |
$output .= ' |
'<span class="LC_nobreak">'. |
<span class="LC_nobreak">'. |
&mt('Language:').' '. |
&mt('Language:').' '. |
&Apache::loncommon::select_form( |
&Apache::loncommon::select_form($env{'form.languages'},'languages', |
$env{'form.languages'}, |
%langchoices).' |
'languages', |
</span>'; |
&Apache::lonlocal::texthash(%langchoices)). |
|
'</span>'; |
|
} |
} |
$output .= |
$output .= ' |
' <span class="LC_nobreak">'. |
<span class="LC_nobreak">'. |
&mt('Math Rendering:').' '. |
&mt('Math Rendering:').' '. |
&Apache::loncommon::select_form( |
&Apache::loncommon::select_form($env{'form.texengine'},'texengine', |
$env{'form.texengine'}, |
('' => '', |
'texengine', |
'tth' => 'tth (TeX to HTML)', |
&Apache::lonlocal::texthash |
'jsMath' => 'jsMath', |
('' => '', |
'mimetex' => 'mimetex (Convert to Images)')).' |
'tth' => 'tth (TeX to HTML)', |
</span>'; |
'jsMath' => 'jsMath', |
|
'mimetex' => 'mimetex (Convert to Images)')). |
|
'</span>'; |
|
return $output; |
return $output; |
} |
} |
|
|
Line 1638 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 1652 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 1676 $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 1724 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 (e.g., from Camtasia) served from https will not display in IE |
# Embedded Flash movies from Camtasia served from https will not display in IE |
# if XML config file has expired from cache. |
# if XML config file has expired from cache. |
if ($ENV{'SERVER_PORT'} == 443) { |
if ($ENV{'SERVER_PORT'} == 443) { |
if ($request->uri =~ /\.xml$/) { |
if ($request->uri =~ /\.xml$/) { |
my ($httpbrowser,$clientbrowser) = |
my ($httpbrowser,$clientbrowser) = |
Line 1770 sub handler {
|
Line 1767 sub handler {
|
if ($filecontents eq -1) { |
if ($filecontents eq -1) { |
my $start_page=&Apache::loncommon::start_page('File Error'); |
my $start_page=&Apache::loncommon::start_page('File Error'); |
my $end_page=&Apache::loncommon::end_page(); |
my $end_page=&Apache::loncommon::end_page(); |
my $fnf=&mt('File not found'); |
my $errormsg='<p class="LC_error">' |
|
.&mt('File not found: [_1]' |
|
,'<span class="LC_filename">'.$file.'</span>') |
|
.'</p>'; |
$result=(<<ENDNOTFOUND); |
$result=(<<ENDNOTFOUND); |
$start_page |
$start_page |
<b>$fnf: $file</b> |
$errormsg |
$end_page |
$end_page |
ENDNOTFOUND |
ENDNOTFOUND |
$filecontents=''; |
$filecontents=''; |
Line 1812 ENDNOTFOUND
|
Line 1812 ENDNOTFOUND
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['rawmode']); |
['rawmode']); |
if ($env{'form.rawmode'}) { $result = $filecontents; } |
if ($env{'form.rawmode'}) { $result = $filecontents; } |
if ($filetype ne 'html') { |
if ($filetype ne 'html') { |
my $nochgview = 1; |
my $nochgview = 1; |
my $controls = |
my $controls = ''; |
($env{'request.state'} eq 'construct') ? &Apache::londefdef::edit_controls($nochgview) |
if ($env{'request.state'} eq 'construct') { |
: ''; |
$controls = &Apache::loncommon::head_subbox( |
|
&Apache::loncommon::CSTR_pageheader() |
|
.&Apache::londefdef::edit_controls($nochgview)); |
|
} |
if ($filetype ne 'sty') { |
if ($filetype ne 'sty') { |
$result =~ s/</</g; |
$result =~ s/</</g; |
$result =~ s/>/>/g; |
$result =~ s/>/>/g; |
Line 1825 ENDNOTFOUND
|
Line 1828 ENDNOTFOUND
|
'</pre></b></td></tr></table>'; |
'</pre></b></td></tr></table>'; |
} |
} |
if ($env{'environment.remote'} eq 'off') { |
if ($env{'environment.remote'} eq 'off') { |
my %options = ('bgcolor' => '#FFFFFF'); |
my $brcrum; |
$result = |
if ($env{'request.state'} eq 'construct') { |
&Apache::loncommon::start_page(undef,undef,\%options). |
$brcrum = [{'href' => &Apache::loncommon::authorspace(), |
$controls. |
'text' => 'Construction Space'}, |
$result. |
{'href' => '', |
&Apache::loncommon::end_page(); |
'text' => 'Editor'}]; |
|
} else { |
|
$brcrum = ''; # FIXME: Where are we? |
|
} |
|
my %options = ('bread_crumbs' => $brcrum, |
|
'bgcolor' => '#FFFFFF'); |
|
$result = |
|
&Apache::loncommon::start_page(undef,undef,\%options) |
|
.$controls |
|
.$result |
|
.&Apache::loncommon::end_page(); |
} else { |
} else { |
$result = $controls.$result; |
$result = $controls.$result; |
} |
} |
} |
} |
} |
} |
} |
} |
|
|
# |
# |
Line 1852 ENDNOTFOUND
|
Line 1865 ENDNOTFOUND
|
|
|
my %options = |
my %options = |
('add_entries' => |
('add_entries' => |
{'onresize' => $add_to_onresize, |
{'onresize' => $add_to_onresize, |
'onload' => $add_to_onload, }); |
'onload' => $add_to_onload, }); |
|
my $header; |
|
if ($env{'request.state'} eq 'construct') { |
|
$options{'bread_crumbs'} = [{ |
|
'href' => &Apache::loncommon::authorspace(), |
|
'text' => 'Construction Space'}, |
|
{'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 1864 ENDNOTFOUND
|
Line 1886 ENDNOTFOUND
|
&Apache::loncommon::resize_textarea_js(); |
&Apache::loncommon::resize_textarea_js(); |
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::lonxml::message_location(). |
.$header |
$edit_info. |
.&Apache::lonxml::message_location() |
&Apache::loncommon::end_page(); |
.$edit_info |
|
.&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); |
|
|