Annotation of loncom/xml/scripttag.pm, revision 1.2
1.1 albertel 1: # The LearningOnline Network with CAPA
2: # <script> definiton
3:
4:
5: package Apache::scripttag;
6:
7: use strict;
8:
9: sub BEGIN {
10: &Apache::lonxml::register('Apache::scripttag',('script'));
11: }
12:
13: sub start_script {
1.2 ! albertel 14: my ($target,$token,$parstack,$parser,$safeeval)=@_;
1.1 albertel 15:
1.2 ! albertel 16: my $result="";
! 17: my $bodytext=$parser->get_text("/script");
! 18: if ($target ne "edit" ) {
! 19: &Apache::run::run($bodytext,$safeeval);
! 20: } else {
! 21: $result="<textarea>$bodytext</textarea>\n";
! 22: }
! 23: return $result;
1.1 albertel 24: }
25:
26: sub end_script {
1.2 ! albertel 27: my ($target,$token,@parstack)=@_;
1.1 albertel 28: }
29: 1;
30: __END__
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>