Diff for /loncom/xml/scripttag.pm between versions 1.102 and 1.103

version 1.102, 2003/10/30 20:20:00 version 1.103, 2003/10/30 20:52:54
Line 104  sub start_script { Line 104  sub start_script {
   my $type= &Apache::lonxml::get_param('type',$parstack,$safeeval);    my $type= &Apache::lonxml::get_param('type',$parstack,$safeeval);
   &Apache::lonxml::debug("found type of $type");    &Apache::lonxml::debug("found type of $type");
   if ($type eq "loncapa/perl") {    if ($type eq "loncapa/perl") {
     my $bodytext=&Apache::lonxml::get_all_text("/script",$parser);  
     if ( $target eq "modified" ) {      if ( $target eq "modified" ) {
  $result=$token->[4].&Apache::edit::modifiedfield();   $result=$token->[4].&Apache::edit::modifiedfield('/script',$parser);
     } 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' ) {
    my $bodytext=&Apache::lonxml::get_all_text("/script",$parser);
  if (!$Apache::lonxml::default_homework_loaded) {   if (!$Apache::lonxml::default_homework_loaded) {
     &Apache::lonxml::default_homework_load($safeeval);      &Apache::lonxml::default_homework_load($safeeval);
  }   }
Line 129  sub start_script { Line 129  sub start_script {
     } 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 />";
       $result=&Apache::edit::tag_start($target,$token,'Script');   my $bodytext=&Apache::lonxml::get_all_text("/script",$parser);
       $result.=&Apache::edit::editfield($token->[1],$bodytext,'',80,4);   $result=&Apache::edit::tag_start($target,$token,'Script');
    $result.=&Apache::edit::editfield($token->[1],$bodytext,'',80,4);
     }      }
   } else {    } else {
     if ($target ne "meta") {      if ($target ne "meta") {
Line 162  sub start_display { Line 163  sub start_display {
   my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;    my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
   
   my $result;    my $result;
   my $bodytext=&Apache::lonxml::get_all_text("/display",$parser);  
   
   if ( $target eq "modified" ) {    if ( $target eq "modified" ) {
     $result=$token->[4].&Apache::edit::modifiedfield();        $result=$token->[4].&Apache::edit::modifiedfield("/display",$parser);
   } 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') {
         my $bodytext=&Apache::lonxml::get_all_text("/display",$parser);
       if (!$Apache::lonxml::default_homework_loaded) {        if (!$Apache::lonxml::default_homework_loaded) {
   &Apache::lonxml::default_homework_load($safeeval);    &Apache::lonxml::default_homework_load($safeeval);
       }        }
Line 179  sub start_display { Line 180  sub start_display {
       }        }
       $Apache::lonxml::post_evaluate=0;        $Apache::lonxml::post_evaluate=0;
   } elsif ($target eq "edit" ) {    } elsif ($target eq "edit" ) {
       my $bodytext=&Apache::lonxml::get_all_text("/display",$parser);
     #$result =       #$result = 
     #  "<br /> &lt;$token->[1]&gt; output: <br />$bodytext<br />Source:<br />";      #  "<br /> &lt;$token->[1]&gt; output: <br />$bodytext<br />Source:<br />";
     #$result.=&Apache::edit::editfield($token->[1],$bodytext,'',40,1);      #$result.=&Apache::edit::editfield($token->[1],$bodytext,'',40,1);
Line 228  sub start_scriptlib { Line 230  sub start_scriptlib {
     &Apache::edit::end_table();      &Apache::edit::end_table();
   }    }
   if ($target eq "modified" ) {    if ($target eq "modified" ) {
     $bodytext=$$parser[$#$parser]->get_text("/scriptlib");        $result=$token->[4].&Apache::edit::modifiedfield("/scriptlib",$parser);
     $result=$token->[4].&Apache::edit::modifiedfield($token);  
     &Apache::lonxml::debug($result);  
   }    }
   return $result;    return $result;
 }  }
Line 274  sub start_parserlib { Line 274  sub start_parserlib {
     &Apache::edit::end_table();      &Apache::edit::end_table();
   }    }
   if ($target eq "modified" ) {    if ($target eq "modified" ) {
     $bodytext=$$parser[$#$parser]->get_text("/parserlib");        $result=$token->[4].&Apache::edit::modifiedfield("/parserlib",$parser);
     $result=$token->[4].&Apache::edit::modifiedfield($token);  
     &Apache::lonxml::debug($result);  
   }    }
   return $result;    return $result;
 }  }
Line 358  sub start_import { Line 356  sub start_import {
     #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");        $result=$token->[4].&Apache::edit::modifiedfield("/import",$parser);
     $result=$token->[4].&Apache::edit::modifiedfield($token);  
     &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);
     $result.='<import part="'.$Apache::inputtags::part;      $result.='<import part="'.$Apache::inputtags::part;
Line 450  sub start_comment { Line 446  sub start_comment {
     my $bodytext=&Apache::lonxml::get_all_text("/comment",$parser);      my $bodytext=&Apache::lonxml::get_all_text("/comment",$parser);
     $result.=&Apache::edit::editfield($token->[1],$bodytext,'',80,4)      $result.=&Apache::edit::editfield($token->[1],$bodytext,'',80,4)
   } elsif ( $target eq 'modified') {    } elsif ( $target eq 'modified') {
     my $bodytext=&Apache::lonxml::get_all_text("/comment",$parser);      $result=$token->[4].&Apache::edit::modifiedfield("/comment",$parser);
     $result=$token->[4].&Apache::edit::modifiedfield($token);  
   } elsif ( $target eq 'web' || $target eq 'tex' || $target eq 'grade' ||    } elsif ( $target eq 'web' || $target eq 'tex' || $target eq 'grade' ||
     $target eq 'answer' || $target eq 'meta' || $target eq 'analyze') {      $target eq 'answer' || $target eq 'meta' || $target eq 'analyze') {
     #normally throw away comments      #normally throw away comments

Removed from v.1.102  
changed lines
  Added in v.1.103


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