Diff for /loncom/xml/scripttag.pm between versions 1.78 and 1.83

version 1.78, 2002/10/14 20:47:11 version 1.83, 2002/11/14 16:47:41
Line 43  BEGIN { Line 43  BEGIN {
   &Apache::lonxml::register('Apache::scripttag',    &Apache::lonxml::register('Apache::scripttag',
     ('script','scriptlib','parserlib','import',      ('script','scriptlib','parserlib','import',
      'window','display','storetc','physnet',       'window','display','storetc','physnet',
      'standalone','comment'));       'standalone','comment',
        'LONCAPA_INTERNAL_TURN_STYLE_ON'));
   }
   
   sub start_LONCAPA_INTERNAL_TURN_STYLE_ON {
       $Apache::lonxml::usestyle=1;
       return ('','no');
   }
   
   sub end_LONCAPA_INTERNAL_TURN_STYLE_ON {
       return ('','no');
 }  }
   
 sub start_script {  sub start_script {
Line 59  sub start_script { Line 69  sub start_script {
     } elsif ( $target eq 'web' || $target eq 'tex' ||      } elsif ( $target eq 'web' || $target eq 'tex' ||
       $target eq 'grade' || $target eq 'answer' ||        $target eq 'grade' || $target eq 'answer' ||
       $target eq 'analyze' ) {        $target eq 'analyze' ) {
       &Apache::run::run($bodytext,$safeeval);   if (!$Apache::lonxml::default_homework_loaded) {
       if (($target eq 'answer') && ($Apache::lonhomework::viewgrades == 'F')) {      &Apache::lonxml::default_homework_load($safeeval);
  $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=&quot;#FFFFFF&quot;><pre>";   &Apache::run::run($bodytext,$safeeval);
  my $listing= &HTML::Entities::encode(&Apache::run::dump($target,$safeeval));   if (($target eq 'answer') && ($Apache::lonhomework::viewgrades == 'F')) {
       $Apache::lonxml::evaluate--;
  $result.=$listing;      $result.="<a href=\"javascript:newWindow=open(\'\',\'new_W\',\'width=500,height=200,scrollbars=1\');newWindow.document.open(\'text/html\',\'replace\');newWindow.document.writeln(\'&lt;html&gt;&lt;head&gt;&lt;title&gt;newwindow&lt;/title&gt;&lt;/head&gt;&lt;body bgcolor=&quot;#FFFFFF&quot;&gt;&lt;pre&gt;";
  $result.= "</pre></body></html>\');newWindow.document.close();void(0);\">Script Vars</a><br />";      my $listing= &HTML::Entities::encode(&Apache::run::dump($target,$safeeval));
       }  
       $result.=$listing;
       $result.= "&lt;/pre&gt;&lt;/body&gt;&lt;/html&gt;\');newWindow.document.close();void(0);\">Script Vars</a><br />";
    }
     } elsif ($target eq "edit" ) {      } elsif ($target eq "edit" ) {
       #&Apache::run::run($bodytext,$safeeval);        #&Apache::run::run($bodytext,$safeeval);
       #$result="<br /> &lt;$token->[1]&gt; output: <br />$bodytext<br />Source:<br />";        #$result="<br /> &lt;$token->[1]&gt; output: <br />$bodytext<br />Source:<br />";
Line 111  sub start_display { Line 124  sub start_display {
   } elsif ( $target eq 'web' || $target eq 'tex' ||    } elsif ( $target eq 'web' || $target eq 'tex' ||
     $target eq 'grade' || $target eq 'answer' ||      $target eq 'grade' || $target eq 'answer' ||
       $target eq 'analyze') {        $target eq 'analyze') {
     $result=&Apache::run::run($bodytext,$safeeval);        if (!$Apache::lonxml::default_homework_loaded) {
     if ($target eq 'grade' || $target eq 'answer' ||    &Apache::lonxml::default_homework_load($safeeval);
       $target eq 'analyze') {        }
       $result=''; # grade should produce no output        $result=&Apache::run::run($bodytext,$safeeval);
     }        if ($target eq 'grade' || $target eq 'answer' ||
     $target eq 'analyze') {
     $result=''; # grade should produce no output
         }
   } elsif ($target eq "edit" ) {    } elsif ($target eq "edit" ) {
     #$result =       #$result = 
     #  "<br /> &lt;$token->[1]&gt; output: <br />$bodytext<br />Source:<br />";      #  "<br /> &lt;$token->[1]&gt; output: <br />$bodytext<br />Source:<br />";
Line 160  sub start_scriptlib { Line 176  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::editline($token->[1],$bodytext,'',40).   &Apache::edit::editline($token->[1],$bodytext,'scriptlib',40).
               &Apache::edit::browse(undef,'textnode').
   $error.'</td></tr>'.    $error.'</td></tr>'.
     &Apache::edit::end_table();      &Apache::edit::end_table();
   }    }
Line 279  sub start_import { Line 296  sub start_import {
   } 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::editline($token->[1],$bodytext,'',40);      $result.=&Apache::edit::editline($token->[1],$bodytext,'',40);
       $result.=&Apache::edit::browse(undef,'textnode');
     #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 />"

Removed from v.1.78  
changed lines
  Added in v.1.83


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