');
}
@@ -2836,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
@@ -2859,15 +2869,39 @@ sub handler {
my $script='';
my $showdoc=0;
+ my $addentries = {};
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,
@@ -2959,7 +2993,22 @@ sub handler {
$iconpath = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL') . "/");
if ($allowed) {
- $script .= &editing_js($udom,$uname);
+ my @tabids;
+ if ($supplementalflag) {
+ @tabids = ('002','ee2','ff2');
+ } else {
+ @tabids = ('aa1','bb1','cc1','ff1');
+ unless ($env{'form.pagepath'}) {
+ unshift(@tabids,'001');
+ push(@tabids,('dd1','ee1'));
+ }
+ }
+ my $tabidstr = join("','",@tabids);
+ $script .= &editing_js($udom,$uname).
+ &resize_contentdiv_js($tabidstr);
+ $addentries = {
+ onload => "javascript:resize_contentdiv('contentscroll','1','1');",
+ };
}
# -------------------------------------------------------------------- Body tag
$script = '