--- loncom/xml/lonxml.pm 2001/08/23 19:41:52 1.124 +++ loncom/xml/lonxml.pm 2001/09/28 18:20:06 1.131 @@ -13,7 +13,10 @@ # 6/12,6/13 H. K. Ng # 6/16 Gerd Kortemeyer # 7/27 H. K. Ng -# 8/7,8/9,8/10,8/11,8/15,8/16,8/17,8/18,8/20 Gerd Kortemeyer +# 8/7,8/9,8/10,8/11,8/15,8/16,8/17,8/18,8/20,8/23,8/24 Gerd Kortemeyer +# Guy Albertelli +# 9/26 Gerd Kortemeyer + package Apache::lonxml; use vars @@ -260,7 +263,11 @@ sub fontsettings() { sub registerurl { my $forcereg=shift; - if ($Apache::lonxml::registered) { return ''; } + if ($ENV{'request.publicaccess'}) { + return + ''; + } + if ($Apache::lonxml::registered && !$forcereg) { return ''; } $Apache::lonxml::registered=1; if (($ENV{'REQUEST_URI'}!~/^\/(res\/)*adm\//) || ($forcereg)) { my $hwkadd=''; @@ -322,9 +329,11 @@ ENDPARM function LONCAPAstale() { menu=window.open("","LONCAPAmenu"); menu.currentStale=1; - //menu.clearbut(7,1); - //menu.clearbut(7,2); - //menu.clearbut(7,3); + menu.switchbutton + (3,1,'reload.gif','return','location','go(currentURL)'); + menu.clearbut(7,1); + menu.clearbut(7,2); + menu.clearbut(7,3); menu.menucltim=menu.setTimeout( 'clearbut(2,1);clearbut(2,3);clearbut(8,1);clearbut(8,2);clearbut(8,3);'+ 'clearbut(9,1);clearbut(9,2);clearbut(9,3);clearbut(6,3)', @@ -406,7 +415,9 @@ sub xmlparse { my $finaloutput = &inner_xmlparse($target,\@stack,\@parstack,\@pars, $safeeval,\%style_for_target); - + if ($ENV{'request.uri'}) { + &writeallows($ENV{'request.uri'}); + } return $finaloutput; } @@ -660,6 +671,11 @@ sub setup_globals { $Apache::lonxml::metamode = 1; $Apache::lonxml::evaluate = 1; $Apache::lonxml::import = 0; + } elsif ($target eq 'answer') { + $Apache::lonxml::redirection = 0; + $Apache::lonxml::metamode = 1; + $Apache::lonxml::evaluate = 1; + $Apache::lonxml::import = 1; } elsif ($target eq 'grade') { &startredirection; $Apache::lonxml::metamode = 0; @@ -874,6 +890,7 @@ sub parstring { } sub writeallows { + unless ($#extlinks>=0) { return; } my $thisurl='/res/'.&Apache::lonnet::declutter(shift); if ($ENV{'httpref.'.$thisurl}) { $thisurl=$ENV{'httpref.'.$thisurl}; @@ -883,7 +900,9 @@ sub writeallows { my %httpref=(); map { $httpref{'httpref.'. - &Apache::lonnet::hreflocation($thisdir,$_)}=$thisurl; } @extlinks; + &Apache::lonnet::hreflocation($thisdir,$_)}=$thisurl; + } @extlinks; + @extlinks=(); &Apache::lonnet::appenv(%httpref); } @@ -1032,10 +1051,11 @@ ENDNOTFOUND unless ($ENV{'request.state'} eq 'published') { $result=&inserteditinfo($result,$filecontents); } + + writeallows($request->uri); $request->print($result); - writeallows($request->uri); return OK; } @@ -1078,7 +1098,11 @@ sub get_param { if ( ! $context ) { $context = -1; } my $args =''; if ( $#$parstack > (-2-$context) ) { $args=$$parstack[$context]; } - return &Apache::run::run("{$args;".'return $'.$param.'}',$safeeval); #' + if ( $args =~ /my \$$param=\"/ ) { + return &Apache::run::run("{$args;".'return $'.$param.'}',$safeeval); #' + } else { + return undef; + } } sub register_insert {