--- loncom/interface/londocs.pm 2011/10/31 01:22:25 1.462 +++ 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.462 2011/10/31 01:22:25 raeburn Exp $ +# $Id: londocs.pm,v 1.466 2011/11/27 22:51:28 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1577,7 +1577,7 @@ sub handle_edit_cmd { if ($cmd eq 'del') { if (($url=~m|/+uploaded/\Q$coursedom\E/\Q$coursenum\E/|) && - ($url!~/\.(page|sequence|problem|exam|quiz|assess|survey|form|library|task)$/)) { + ($url!~/$LONCAPA::assess_page_seq_re/)) { &Apache::lonnet::removeuploadedurl($url); } else { &LONCAPA::map::makezombie($LONCAPA::map::order[$idx]); @@ -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 @@ -2872,12 +2873,35 @@ sub handler { my $containertag; my $uploadtag; +# Do we directly jump somewhere? + + if ($env{'form.command'} eq 'direct') { + 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}; + 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? my $stored_folderpath='docs_folderpath'; if ($supplementalflag) { $stored_folderpath='docs_sup_folderpath'; } - + # No folderpath, no pagepath, see if we have something stored if ((!$env{'form.folderpath'}) && (!$env{'form.pagepath'})) { &Apache::loncommon::restore_course_settings($stored_folderpath,