--- loncom/xml/londefdef.pm 2003/10/10 19:05:31 1.179 +++ loncom/xml/londefdef.pm 2003/10/24 21:48:17 1.189 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.179 2003/10/10 19:05:31 sakharuk Exp $ +# $Id: londefdef.pm,v 1.189 2003/10/24 21:48:17 albertel Exp $ # # # Copyright Michigan State University Board of Trustees @@ -50,8 +50,8 @@ use Apache::File(); use Image::Magick; use Apache::lonmenu(); use Apache::lonmeta(); +use Apache::Constants qw(:common); -$Apache::londefdef::TD_redirection=0; BEGIN { @@ -59,6 +59,15 @@ BEGIN { } +sub initialize_londefdef { + $Apache::londefdef::TD_redirection=0; + @Apache::londefdef::table = (); + $Apache::londefdef::select=0; + @Apache::londefdef::description=(); + $Apache::londefdef::DD_redirection=0; + $Apache::londefdef::DT_redirection=0; +} + #======================= TAG SUBROUTINES ===================== #-- sub start_output { @@ -140,7 +149,7 @@ sub end_tthoption { return $result; } -#-- tag +#-- tag (end tag optional) sub start_html { my ($target,$token) = @_; my $currentstring = ''; @@ -159,7 +168,7 @@ sub start_html { &tth::tthoptions('-L -u0'); } } - if ($target eq 'web') { + if ($target eq 'web' || $target eq 'edit') { $currentstring = &Apache::lonxml::xmlbegin(). &Apache::lonxml::fontsettings(); } elsif ($target eq 'tex') { @@ -188,7 +197,7 @@ sub end_html { return $currentstring; } -#-- tag +#-- tag (end tag optional) sub start_head { my ($target,$token) = @_; my $currentstring = ''; @@ -201,14 +210,14 @@ sub start_head { sub end_head { my ($target,$token) = @_; my $currentstring = ''; - if ($target eq 'web') { + if ($target eq 'web' && $ENV{'request.state'} eq 'published') { $currentstring = &Apache::lonmenu::registerurl(undef,$target). $token->[2]; } return $currentstring; } -#-- tag +#-- tag (end tag required) sub start_map { my ($target,$token) = @_; my $currentstring = ''; @@ -227,13 +236,15 @@ sub end_map { return $currentstring; } -#-- tag (end tag required) sub start_select { my ($target,$token) = @_; my $currentstring = ''; if ($target eq 'web') { $currentstring = $token->[4]; - } + } elsif ($target eq 'tex') { + $Apache::londefdef::select=0; + } return $currentstring; } @@ -246,13 +257,20 @@ sub end_select { return $currentstring; } -#--