--- loncom/interface/londocs.pm 2011/11/27 21:04:19 1.465 +++ loncom/interface/londocs.pm 2011/11/27 22:51:28 1.466 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.465 2011/11/27 21:04:19 www Exp $ +# $Id: londocs.pm,v 1.466 2011/11/27 22:51:28 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2845,7 +2845,8 @@ sub handler { # &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['folderpath','pagepath', - 'pagesymb','forcesupplement','forcestandard']); + 'pagesymb','forcesupplement','forcestandard', + 'symb','command']); # standard=1: this is a "new-style" course with an uploaded map as top level # standard=2: this is a "old-style" course, and there is nothing we can do @@ -2873,15 +2874,26 @@ sub handler { my $uploadtag; # Do we directly jump somewhere? + if ($env{'form.command'} eq 'direct') { - (my $mapurl) = &Apache::lonnet::decode_symb($env{'form.symb'}); + my ($mapurl,$id,$resurl) = &Apache::lonnet::decode_symb($env{'form.symb'}); + if ($resurl=~/\.(sequence|page)$/) { + $mapurl=$resurl; + } my $maptitle = &Apache::lonnet::gettitle($mapurl); - $mapurl=~s{^.*/([^/]+)\.\w+$}{$1}; - $env{'form.folderpath'}= - 'default&'.&Apache::lonhtmlcommon::entity_encode('Main Course Documents'). - '&default&...::::&'. - &Apache::lonhtmlcommon::entity_encode($mapurl).'&'. + $mapurl=~s{^.*/([^/]+)\.(\w+)$}{$1}; + my $type=$2; + my $path='default&'.&Apache::lonhtmlcommon::entity_encode('Main Course Documents'). + '&default&...::::&'. + &Apache::lonhtmlcommon::entity_encode($mapurl).'&'. &Apache::lonhtmlcommon::entity_encode($maptitle).'::::'; + if ($type eq 'sequence') { + $env{'form.folderpath'}=$path; + $env{'form.pagepath'}=''; + } else { + $env{'form.pagepath'}=$path; + $env{'form.folderpath'}=''; + } } # Where do we store these for when we come back?