Diff for /loncom/xml/scripttag.pm between versions 1.123 and 1.128

version 1.123, 2005/02/24 01:21:50 version 1.128, 2005/06/06 01:29:45
Line 31  package Apache::scripttag; Line 31  package Apache::scripttag;
 use strict;  use strict;
 use Apache::lonnet;  use Apache::lonnet;
 use Apache::style;  use Apache::style;
 use AlgParser;  
   
 #Globals  #Globals
 # this used to pass around the standard callsub arguments to a tag func  # this used to pass around the standard callsub arguments to a tag func
Line 114  sub start_script { Line 113  sub start_script {
  }   }
  &Apache::run::run($bodytext,$safeeval);   &Apache::run::run($bodytext,$safeeval);
  if (($target eq 'answer') &&   if (($target eq 'answer') &&
     ($ENV{'form.answer_output_mode'} ne 'tex') &&      ($env{'form.answer_output_mode'} ne 'tex') &&
     ($Apache::lonhomework::viewgrades == 'F')) {      ($Apache::lonhomework::viewgrades == 'F')) {
     $Apache::lonxml::evaluate--;      $Apache::lonxml::evaluate--;
     my (undef,undef,$udom,$uname)=&Apache::lonxml::whichuser();      my (undef,undef,$udom,$uname)=&Apache::lonxml::whichuser();
     my $windowopen=&Apache::lonhtmlcommon::javascript_docopen();      my $windowopen=&Apache::lonhtmlcommon::javascript_docopen();
     $result.="<script type=\"text/javascript\">      $result.="<script type=\"text/javascript\">
 // <!--  // <![CDATA[
     function LONCAPA_scriptvars_".$uname."_".$udom."_"."$Apache::lonxml::curdepth() {newWindow=open('','new_W','width=500,height=500,scrollbars=1,resizable=yes');newWindow.$windowopen;newWindow.document.writeln('<html><head><title>Script Vars</title></head><body bgcolor=\"#FFFFFF\"><pre>";      function LONCAPA_scriptvars_".$uname."_".$udom."_"."$Apache::lonxml::curdepth() {newWindow=open('','new_W','width=500,height=500,scrollbars=1,resizable=yes');newWindow.$windowopen;newWindow.document.writeln('<html><head><title>Script Vars</title></head><body bgcolor=\"#FFFFFF\"><pre>";
     my $listing=&Apache::run::dump($target,$safeeval);      my $listing=&Apache::run::dump($target,$safeeval);
       $listing=~s/\\/\\\\/g;
     $listing=~s/\'/\\\'/g;      $listing=~s/\'/\\\'/g;
     $listing=~s/\n/\\n/g;  
     $listing=~s/\r/\\r/g;  
     $result.=$listing;      $result.=$listing;
     $result.= "</pre></body></html>');newWindow.document.close();}      $result.= "</pre></body></html>');newWindow.document.close();newWindow.focus()}
 // -->  // ]]>
 </script><a href=\"javascript:LONCAPA_scriptvars_".$uname."_".$udom."_$Apache::lonxml::curdepth();void(0);\">Script Vars</a><br />";  </script><a href=\"javascript:LONCAPA_scriptvars_".$uname."_".$udom."_$Apache::lonxml::curdepth();void(0);\">Script Vars</a><br />";
  }   }
     } elsif ($target eq "edit" ) {      } elsif ($target eq "edit" ) {
Line 443  sub start_standalone { Line 441  sub start_standalone {
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;    my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   my $result='';    my $result='';
   if ($target eq 'web' ) {    if ($target eq 'web' ) {
     if ( $ENV{'request.course.id'} ) {      if ( $env{'request.course.id'} ) {
       my $inside = &Apache::lonxml::get_all_text("/standalone",$parser);        my $inside = &Apache::lonxml::get_all_text("/standalone",$parser);
     } else {      } else {
       $result='<table bgcolor="#E1E1E1" border="2"><tr><td>';        $result='<table bgcolor="#E1E1E1" border="2"><tr><td>';
Line 456  sub end_standalone { Line 454  sub end_standalone {
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;    my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   my $result='';    my $result='';
   if ($target eq 'web' ) {    if ($target eq 'web' ) {
     if ( $ENV{'request.course.id'} ) {      if ( $env{'request.course.id'} ) {
     } else {      } else {
       $result='</td></tr></table>';        $result='</td></tr></table>';
     }      }
Line 564  sub start_algebra { Line 562  sub start_algebra {
  my $inside = &Apache::lonxml::get_all_text_unbalanced("/algebra",$parser);   my $inside = &Apache::lonxml::get_all_text_unbalanced("/algebra",$parser);
  $inside = &Apache::run::evaluate($inside,$safeeval,$$parstack[-1]);   $inside = &Apache::run::evaluate($inside,$safeeval,$$parstack[-1]);
  if ($target eq 'web' || $target eq 'tex' || $target eq 'analyze') {   if ($target eq 'web' || $target eq 'tex' || $target eq 'analyze') {
     $result=&Apache::lontexconvert::algebra($inside,$target);      my $style=&Apache::lonxml::get_param('style',$parstack,$safeeval);
       $result=&Apache::lontexconvert::algebra($inside,$target,$style);
  }   }
  $Apache::lonxml::post_evaluate=0;   $Apache::lonxml::post_evaluate=0;
     }      }

Removed from v.1.123  
changed lines
  Added in v.1.128


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>