--- loncom/xml/lonxml.pm 2012/11/29 20:47:11 1.534 +++ loncom/xml/lonxml.pm 2013/03/11 21:37:10 1.538 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.534 2012/11/29 20:47:11 raeburn Exp $ +# $Id: lonxml.pm,v 1.538 2013/03/11 21:37:10 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1670,6 +1670,11 @@ sub handler { } else { $filetype='html'; } + unless ($env{'request.uri'}) { + $env{'request.uri'}=$request->uri; + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, + ['todocs']); + } if ($filetype eq 'sty') { $breadcrumbtext = 'Style File Editor'; } elsif ($filetype eq 'js') { @@ -1875,6 +1880,7 @@ sub get_courseupload_hierarchy { while (@folders) { my $folder=shift(@folders); my $foldername=shift(@folders); + $foldername =~ s/\:(\d*)\:(\w*)\:(\w*):(\d*)\:?(\d*)$//; push(@pathitems,&unescape($foldername)); } if ($title) { @@ -2050,16 +2056,25 @@ sub add_messages { } sub get_param { - my ($param,$parstack,$safeeval,$context,$case_insensitive) = @_; + my ($param,$parstack,$safeeval,$context,$case_insensitive, $noelide) = @_; + if ( ! $context ) { $context = -1; } my $args =''; if ( $#$parstack > (-2-$context) ) { $args=$$parstack[$context]; } if ( ! $Apache::lonxml::usestyle ) { $args=$Apache::lonxml::style_values.$args; } + + + if ($noelide) { +# $args =~ s/\\'/'/g; + $args =~ s/'\$/'\\\$/g; + } + if ( ! $args ) { return undef; } if ( $case_insensitive ) { if ($args =~ s/(my (?:.*))(\$\Q$param\E[,\)])/$1.lc($2)/ei) { + return &Apache::run::run("{$args;".'return $'.$param.'}', $safeeval); #' } else { @@ -2067,6 +2082,7 @@ sub get_param { } } else { if ( $args =~ /my .*\$\Q$param\E[,\)]/ ) { + return &Apache::run::run("{$args;".'return $'.$param.'}', $safeeval); #' } else {