version 1.167, 2002/04/10 15:19:59
|
version 1.170, 2002/05/16 17:05:02
|
Line 60
|
Line 60
|
|
|
package Apache::lonxml; |
package Apache::lonxml; |
use vars |
use vars |
qw(@pwd @outputstack $redirection $import @extlinks $metamode $evaluate %insertlist @namespace); |
qw(@pwd @outputstack $redirection $import @extlinks $metamode $evaluate %insertlist @namespace $prevent_entity_encode); |
use strict; |
use strict; |
use HTML::LCParser(); |
use HTML::LCParser(); |
use HTML::TreeBuilder(); |
use HTML::TreeBuilder(); |
Line 129 $evaluate = 1;
|
Line 129 $evaluate = 1;
|
# stores the list of active tag namespaces |
# stores the list of active tag namespaces |
@namespace=(); |
@namespace=(); |
|
|
|
# if 0 all high ASCII characters will be encoded into HTML Entities |
|
$prevent_entity_encode=0; |
|
|
# has the dynamic menu been updated to know about this resource |
# has the dynamic menu been updated to know about this resource |
$Apache::lonxml::registered=0; |
$Apache::lonxml::registered=0; |
|
|
Line 336 sub registerurl {
|
Line 339 sub registerurl {
|
if ($ENV{'browser.type'} eq 'explorer') { $nothing='javascript:void(0);'; } |
if ($ENV{'browser.type'} eq 'explorer') { $nothing='javascript:void(0);'; } |
if (($ENV{'REQUEST_URI'}!~/^\/(res\/)*adm\//) || ($forcereg)) { |
if (($ENV{'REQUEST_URI'}!~/^\/(res\/)*adm\//) || ($forcereg)) { |
my $hwkadd=''; |
my $hwkadd=''; |
if ($ENV{'REQUEST_URI'}=~/\.(problem|exam|quiz|assess|survey|form)$/) { |
if ($ENV{'request.filename'}=~/\.(problem|exam|quiz|assess|survey|form)$/) { |
if (&Apache::lonnet::allowed('vgr',$ENV{'request.course.id'})) { |
if (&Apache::lonnet::allowed('vgr',$ENV{'request.course.id'})) { |
$hwkadd.=(<<ENDSUBM); |
$hwkadd.=(<<ENDSUBM); |
menu.switchbutton |
menu.switchbutton(7,1,'subm.gif','view sub','missions','gocmd("/adm/grades","submission")'); |
(7,1,'subm.gif','view sub','missions', |
|
'gocmd("/adm/grades","submission")'); |
|
ENDSUBM |
ENDSUBM |
} |
} |
if (&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'})) { |
if (&Apache::lonnet::allowed('mgr',$ENV{'request.course.id'})) { |
$hwkadd.=(<<ENDGRDS); |
$hwkadd.=(<<ENDGRDS); |
menu.switchbutton |
menu.switchbutton(7,2,'pgrd.gif','problem','grades','gocmd("/adm/grades","viewgrades")'); |
(7,2,'pgrd.gif','problem','grades', |
|
'gocmd("/adm/grades","viewgrades")'); |
|
ENDGRDS |
ENDGRDS |
} |
} |
if (&Apache::lonnet::allowed('opa',$ENV{'request.course.id'})) { |
if (&Apache::lonnet::allowed('opa',$ENV{'request.course.id'})) { |
$hwkadd.=(<<ENDPARM); |
$hwkadd.=(<<ENDPARM); |
menu.switchbutton |
menu.switchbutton(7,3,'pparm.gif','problem','parms','gocmd("/adm/parmset","set")'); |
(7,3,'pparm.gif','problem','parms', |
|
'gocmd("/adm/parmset","set")'); |
|
ENDPARM |
ENDPARM |
} |
} |
} |
} |
Line 630 sub inner_xmlparse {
|
Line 627 sub inner_xmlparse {
|
#evaluate variable refs in result |
#evaluate variable refs in result |
if ($result ne "") { |
if ($result ne "") { |
if ( $#$parstack > -1 ) { |
if ( $#$parstack > -1 ) { |
if ($Apache::lonxml::redirection) { |
$result=&Apache::run::evaluate($result,$safeeval,$$parstack[-1]); |
$Apache::lonxml::outputstack['-1'] .= |
|
&Apache::run::evaluate($result,$safeeval,$$parstack['-1']); |
|
} else { |
|
$finaloutput .= &Apache::run::evaluate($result,$safeeval, |
|
$$parstack['-1']); |
|
} |
|
} else { |
} else { |
$finaloutput .= &Apache::run::evaluate($result,$safeeval,''); |
$result= &Apache::run::evaluate($result,$safeeval,''); |
} |
} |
$result = ''; |
|
} |
} |
|
# Encode any high ASCII characters |
|
if (!$Apache::lonxml::prevent_entity_encode) { |
|
$result=&HTML::Entities::encode($result,"\200-\377"); |
|
} |
|
if ($Apache::lonxml::redirection) { |
|
$Apache::lonxml::outputstack['-1'] .= $result; |
|
} else { |
|
$finaloutput.=$result; |
|
} |
|
$result = ''; |
|
|
if ($token->[0] eq 'E') { |
if ($token->[0] eq 'E') { |
&end_tag($stack,$parstack,$token); |
&end_tag($stack,$parstack,$token); |
} |
} |
Line 654 sub inner_xmlparse {
|
Line 655 sub inner_xmlparse {
|
# $finaloutput.=&endredirection; |
# $finaloutput.=&endredirection; |
# } |
# } |
|
|
# Encode any high ASCII characters |
|
$finaloutput=&HTML::Entities::encode($finaloutput,"\200-\377"); |
|
if (($ENV{'QUERY_STRING'}) && ($target eq 'web')) { |
if (($ENV{'QUERY_STRING'}) && ($target eq 'web')) { |
$finaloutput=&afterburn($finaloutput); |
$finaloutput=&afterburn($finaloutput); |
} |
} |
Line 1128 BUTTONS
|
Line 1128 BUTTONS
|
<a name="editsection" /> |
<a name="editsection" /> |
<form method="post"> |
<form method="post"> |
<input type="hidden" name="editmode" value="Edit" /> |
<input type="hidden" name="editmode" value="Edit" /> |
$buttons |
$buttons<br /> |
<textarea cols="80" rows="40" name="filecont">$filecontents</textarea> |
<textarea cols="80" rows="40" name="filecont">$filecontents</textarea> |
$buttons |
<br />$buttons |
<br /> |
<br /> |
</form> |
</form> |
ENDFOOTER |
ENDFOOTER |