version 1.60, 2001/12/10 16:42:20
|
version 1.70, 2002/04/10 15:21:29
|
Line 39 use Apache::style;
|
Line 39 use Apache::style;
|
# so xmlparse can reenter the inner_xmlparse loop. |
# so xmlparse can reenter the inner_xmlparse loop. |
|
|
@Apache::scripttag::parser_env = (); |
@Apache::scripttag::parser_env = (); |
sub BEGIN { |
BEGIN { |
&Apache::lonxml::register('Apache::scripttag',('script','scriptlib', |
&Apache::lonxml::register('Apache::scripttag', |
'parserlib','import', |
('script','scriptlib','parserlib','import', |
'window','display', |
'window','display','storetc','physnet', |
'storetc','physnet')); |
'standalone')); |
} |
} |
|
|
sub start_script { |
sub start_script { |
Line 62 sub start_script {
|
Line 62 sub start_script {
|
if (($target eq 'answer') && ($Apache::lonhomework::viewgrades == 'F')) { |
if (($target eq 'answer') && ($Apache::lonhomework::viewgrades == 'F')) { |
$Apache::lonxml::evaluate--; |
$Apache::lonxml::evaluate--; |
$result.="<a href=\"javascript:newWindow=open(\'\',\'new_W\',\'width=500,height=200,scrollbars=1\');newWindow.document.open(\'text/html\',\'replace\');newWindow.document.writeln(\'<html><head><title>newwindow</title></head><body bgcolor="#FFFFFF"><pre>"; |
$result.="<a href=\"javascript:newWindow=open(\'\',\'new_W\',\'width=500,height=200,scrollbars=1\');newWindow.document.open(\'text/html\',\'replace\');newWindow.document.writeln(\'<html><head><title>newwindow</title></head><body bgcolor="#FFFFFF"><pre>"; |
my $listing= &Apache::run::dump($target,$safeeval); |
my $listing= &HTML::Entities::encode(&Apache::run::dump($target,$safeeval)); |
$listing =~ s/\n/\\n/g; |
|
$listing =~ s/\"/"/g; |
|
$listing =~ s/\'/’/g; |
|
$listing =~ s/</</g; |
|
$listing =~ s/>/>/g; |
|
$listing =~ s/&/&/g; |
|
$result.=$listing; |
$result.=$listing; |
$result.= "</pre></body></html>\');newWindow.document.close();void(0);\">Script Vars</a><br />"; |
$result.= "</pre></body></html>\');newWindow.document.close();void(0);\">Script Vars</a><br />"; |
} |
} |
Line 79 sub start_script {
|
Line 73 sub start_script {
|
$result.=&Apache::edit::editfield($token->[1],$bodytext,'',50,4); |
$result.=&Apache::edit::editfield($token->[1],$bodytext,'',50,4); |
} |
} |
} else { |
} else { |
if ($target ne "meta") { $result = $token->[4]; } |
if ($target ne "meta") { |
|
$result = $token->[4]; |
|
my $bodytext=&Apache::lonxml::get_all_text("/script",$$parser[$#$parser]); |
|
$result.=$bodytext; |
|
} |
} |
} |
return $result; |
return $result; |
} |
} |
Line 157 sub start_scriptlib {
|
Line 155 sub start_scriptlib {
|
if ($target eq "edit" ) { |
if ($target eq "edit" ) { |
$result= |
$result= |
&Apache::edit::tag_start($target,$token,'New Script Functions'). |
&Apache::edit::tag_start($target,$token,'New Script Functions'). |
&Apache::edit::editfield($token->[1],$bodytext,'',40,1). |
&Apache::edit::editline($token->[1],$bodytext,'',40). |
$error.'</td></tr>'. |
$error.'</td></tr>'. |
&Apache::edit::end_table(); |
&Apache::edit::end_table(); |
} |
} |
if ($target eq "modified" ) { |
if ($target eq "modified" ) { |
$bodytext=$$parser[$#$parser]->get_text("/scriptlib"); |
$bodytext=$$parser[$#$parser]->get_text("/scriptlib"); |
$result=&Apache::edit::modifiedfield($token); |
$result=$token->[4].&Apache::edit::modifiedfield($token); |
&Apache::lonxml::debug($result); |
&Apache::lonxml::debug($result); |
} |
} |
return $result; |
return $result; |
Line 202 sub start_parserlib {
|
Line 200 sub start_parserlib {
|
if ($target eq "edit" ) { |
if ($target eq "edit" ) { |
$result= |
$result= |
&Apache::edit::tag_start($target,$token,'New Tag Definitions'). |
&Apache::edit::tag_start($target,$token,'New Tag Definitions'). |
&Apache::edit::editfield($token->[1],$bodytext,'',40,1). |
&Apache::edit::editline($token->[1],$bodytext,'',40). |
$error.'</td></tr>'. |
$error.'</td></tr>'. |
&Apache::edit::end_table(); |
&Apache::edit::end_table(); |
} |
} |
if ($target eq "modified" ) { |
if ($target eq "modified" ) { |
$bodytext=$$parser[$#$parser]->get_text("/parserlib"); |
$bodytext=$$parser[$#$parser]->get_text("/parserlib"); |
$result=&Apache::edit::modifiedfield($token); |
$result=$token->[4].&Apache::edit::modifiedfield($token); |
&Apache::lonxml::debug($result); |
&Apache::lonxml::debug($result); |
} |
} |
return $result; |
return $result; |
Line 273 sub start_import {
|
Line 271 sub start_import {
|
&Apache::lonxml::newparser($parser,\$file,$dir); |
&Apache::lonxml::newparser($parser,\$file,$dir); |
} elsif ($target eq "edit" ) { |
} elsif ($target eq "edit" ) { |
$result.=&Apache::edit::tag_start($target,$token); |
$result.=&Apache::edit::tag_start($target,$token); |
$result.=&Apache::edit::editfield($token->[1],$bodytext,'',40,1); |
$result.=&Apache::edit::editline($token->[1],$bodytext,'',40); |
#FIXME this need to convert $bodytext to be a contruction space reference |
#FIXME this need to convert $bodytext to be a contruction space reference |
#my $location=&Apache::lonnet::filelocation($Apache::lonxml::pwd['-1'],$bodytext); |
#my $location=&Apache::lonnet::filelocation($Apache::lonxml::pwd['-1'],$bodytext); |
#$result.="Click<a href=\"$location\">here</a> to edit<br />" |
#$result.="Click<a href=\"$location\">here</a> to edit<br />" |
} elsif ($target eq 'modified') { |
} elsif ($target eq 'modified') { |
$bodytext=$$parser[$#$parser]->get_text("/import"); |
$bodytext=$$parser[$#$parser]->get_text("/import"); |
$result=&Apache::edit::modifiedfield($token); |
$result=$token->[4].&Apache::edit::modifiedfield($token); |
&Apache::lonxml::debug($result); |
&Apache::lonxml::debug($result); |
} elsif ($target eq 'meta') { |
} elsif ($target eq 'meta') { |
my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); |
my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); |
Line 295 sub start_import {
|
Line 293 sub start_import {
|
} |
} |
|
|
sub end_import { |
sub end_import { |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
pop(@Apache::inputtags::import); |
pop(@Apache::inputtags::import); |
return ''; |
my $result; |
|
if ($target eq 'edit' ) { $result=&Apache::edit::end_table(); } |
|
return $result; |
} |
} |
|
|
sub start_storetc { |
sub start_storetc { |
Line 334 sub end_physnet {
|
Line 335 sub end_physnet {
|
return ''; |
return ''; |
} |
} |
|
|
|
sub start_standalone { |
|
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; |
|
if ($target eq 'web' && $ENV{'request.course.id'} ) { |
|
my $inside = &Apache::lonxml::get_all_text("/standalone",$$parser[-1]); |
|
} |
|
return ''; |
|
} |
|
|
|
sub end_standalone { |
|
return ''; |
|
} |
|
|
|
|
sub xmlparse { |
sub xmlparse { |
my ($string) = @_; |
my ($string) = @_; |
&Apache::lonxml::debug("Got $string"); |
&Apache::lonxml::debug("Got $string"); |