--- loncom/xml/lonxml.pm 2002/02/21 04:11:25 1.152 +++ loncom/xml/lonxml.pm 2002/03/08 18:32:55 1.156 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.152 2002/02/21 04:11:25 albertel Exp $ +# $Id: lonxml.pm,v 1.156 2002/03/08 18:32:55 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -316,6 +316,8 @@ sub fontsettings() { sub registerurl { my $forcereg=shift; + my $target = shift; + my $result = ''; if ($ENV{'request.publicaccess'}) { return ''; @@ -347,7 +349,7 @@ ENDGRDS ENDPARM } } - return (< // BEGIN LON-CAPA Internal @@ -399,7 +401,7 @@ ENDPARM ENDREGTHIS } else { - return (< // BEGIN LON-CAPA Internal @@ -426,8 +428,52 @@ ENDREGTHIS // END LON-CAPA Internal ENDDONOTREGTHIS - } + if ($target eq 'edit') { + # Javascript routines for construction space: + # openbrowser and opensearcher will start the file browser + # (lonindexer) and searcher (lonsearchcat) respectively. + # Inputs are the name of the html form being used + # and the name of the element the selected URL should + # be placed in. + $result .=<<"ENDBROWSERSCRIPT"; + +ENDBROWSERSCRIPT + } + return $result; } sub loadevents() { @@ -978,16 +1024,8 @@ sub writeallows { # sub afterburn { my $result=shift; - foreach (split(/&/,$ENV{'QUERY_STRING'})) { - my ($name, $value) = split(/=/,$_); - $value =~ tr/+/ /; - $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; - if (($name eq 'highlight')||($name eq 'anchor')||($name eq 'link')) { - unless ($ENV{'form.'.$name}) { - $ENV{'form.'.$name}=$value; - } - } - } + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, + ['highlight','anchor','link']); if ($ENV{'form.highlight'}) { foreach (split(/\,/,$ENV{'form.highlight'})) { my $anchorname=$_; @@ -1075,6 +1113,13 @@ sub get_target { if ( defined($ENV{'form.grade_target'}) && ($viewgrades == 'F' )) { return ($ENV{'form.grade_target'}); + } elsif (defined($ENV{'form.grade_target'})) { + if (($ENV{'form.grade_target'} eq 'web') || + ($ENV{'form.grade_target'} eq 'tex') ) { + return $ENV{'form.grade_target'} + } else { + return 'web'; + } } else { return 'web'; }