--- loncom/xml/scripttag.pm 2001/06/26 21:45:58 1.41 +++ loncom/xml/scripttag.pm 2001/07/06 19:50:02 1.42 @@ -6,11 +6,13 @@ package Apache::scripttag; use strict; use Apache::lonnet; +use Apache::style; sub BEGIN { &Apache::lonxml::register('Apache::scripttag',('script','scriptlib', 'parserlib','import', - 'window','display')); + 'window','display', + 'storetc','physnet')); } sub start_script { @@ -169,7 +171,7 @@ sub start_window { if ($target eq 'web') { &Apache::lonxml::startredirection; } elsif ($target eq 'tex') { - $result = '\footnote{'; + $result = '\unskip\footnote{'; } return $result; } @@ -232,5 +234,64 @@ sub start_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 "
\n<$tag>
\n   
\n</$tag>
\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 { + my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; + my $result = ''; + &Apache::lonxml::startredirection; + return $result; +} + +sub end_storetc { + my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; + my $result; + my $output=&Apache::lonxml::endredirection; + $output =~ s/\"/\"\;/g; + $result = "{\bf $output.}}\write\tcfile{\protect\tcpc{ $output.}{\the\value{relpage}}}"; + return $result; +} + + +sub start_physnet { + + my ($target,$token,$parstack,$parser,$safeeval,$style)=@_; + my $cbistylefile = &Apache::lonnet::getfile('/home/httpd/res/msu/physnet/cbi.sty'); + %$style = (%$style,&Apache::style::styleparser($target,$cbistylefile)); + &Apache::lonxml::newparser($parser$$style{'physnet'}); + + return ""; +} + + 1; __END__