Diff for /loncom/xml/scripttag.pm between versions 1.42 and 1.45

version 1.42, 2001/07/06 19:50:02 version 1.45, 2001/07/11 14:44:37
Line 123  sub start_parserlib { Line 123  sub start_parserlib {
   my $bodytext;    my $bodytext;
   my $result ="";    my $result ="";
   my $error='';    my $error='';
   
   if ($target eq 'web' || $target eq 'grade' || $target eq 'meta' || $target eq 'edit') {    if ($target eq 'web' || $target eq 'grade' || $target eq 'meta' || $target eq 'edit') {
     $bodytext=$$parser[$#$parser]->get_text("/parserlib");      $bodytext=$$parser[$#$parser]->get_text("/parserlib");
     $bodytext=&Apache::run::evaluate($bodytext,$safeeval,      $bodytext=&Apache::run::evaluate($bodytext,$safeeval,
Line 217  sub start_import { Line 216  sub start_import {
 }  }
   
 sub end_import {  sub end_import {
     return '';
 }  }
   
 sub start_meta {  sub start_meta {
Line 234  sub start_meta { Line 234  sub start_meta {
 sub end_meta {  sub end_meta {
 }  }
   
 sub editfield {  
   my ($tag,$data)=@_;  
     
   my $count=0;  
   my $maxlength=-1;  
   map { $count++;  
  if (length($_) > $maxlength) { $maxlength = length ($_); }  
       } split ("\n", $data);  
     
   return "<br />\n&lt;$tag&gt;<br />\n&nbsp;&nbsp;&nbsp;<textarea rows=\"$count\" cols=\"$maxlength\" name=homework_edit_".$Apache::lonxml::curdepth.">$data</textarea><br />\n&lt;/$tag&gt;<br />\n";  
 }  
   
 sub getfilenothere {  
   my ($filename) = @_;  
   my $a="";  
     
   $filename=~ s/^\s*(\S+)\s*$/$1/; ## strip off leading and trailing spaces  
   $filename="/home/httpd/html/res".$filename;  
   if (! -e $filename ) {  
     &Apache::lonnet::subscribe($filename);  
     &Apache::lonnet::repcopy($filename);  
   }  
   if (! -e $filename ) { return -1; };  
   my $fh=Apache::File->new($filename);  
   while (<$fh>) {  
       $a .=$_;  
   }  
   return $a  
 }  
   
   
 sub start_storetc {  sub start_storetc {
   my ($target,$token,$parstack,$parser,$safeeval,$style)=@_;    my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
   my $result = '';    my $result = '';
   &Apache::lonxml::startredirection;    &Apache::lonxml::startredirection;
   return $result;     return $result; 
 }  }
   
 sub end_storetc {  sub end_storetc {
     my ($target,$token,$parstack,$parser,$safeeval,$style)=@_;      my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my $result;      my $result;
     my $output=&Apache::lonxml::endredirection;      my $output=&Apache::lonxml::endredirection;
     $output =~ s/\"/\&quot\;/g;      $output =~ s/\"/\&quot\;/g;
Line 283  sub end_storetc { Line 252  sub end_storetc {
   
   
 sub start_physnet {  sub start_physnet {
       my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
     my ($target,$token,$parstack,$parser,$safeeval,$style)=@_;      my $bodytext = '/msu/physnet/cbi.sty';
     my $cbistylefile = &Apache::lonnet::getfile('/home/httpd/res/msu/physnet/cbi.sty');      my $location=&Apache::lonnet::filelocation($Apache::lonxml::pwd['-1'],$bodytext);
     %$style = (%$style,&Apache::style::styleparser($target,$cbistylefile));      my $cbistyletext=&Apache::lonnet::getfile($location);
     &Apache::lonxml::newparser($parser$$style{'physnet'});  
       %$style = (%$style,&Apache::style::styleparser($target,$cbistyletext));
       if ( defined($$style{'physnet'}) ) {
           &Apache::lonxml::newparser($parser,\$$style{'physnet'});
       }
     return "";      return "";
 }  }
   
   sub end_physnet {
   }
   
   
 1;  1;
 __END__  __END__

Removed from v.1.42  
changed lines
  Added in v.1.45


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