--- loncom/interface/londocs.pm 2010/08/14 04:28:21 1.432
+++ loncom/interface/londocs.pm 2010/08/16 20:52:11 1.434.2.1
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.432 2010/08/14 04:28:21 raeburn Exp $
+# $Id: londocs.pm,v 1.434.2.1 2010/08/16 20:52:11 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2718,9 +2718,22 @@ sub handler {
$env{'form.pagename'}=&unescape(pop(@pagepath));
$env{'form.folder'}=pop(@pagepath);
$containertag = ''.
- '';
- $uploadtag = ''.
- '';
+ '';
+ $uploadtag =
+ ''.
+ ''.
+ '';
+ } else {
+ my $folderpath=$env{'form.folderpath'};
+ if (!$folderpath) {
+ if ($env{'form.folder'} eq '' ||
+ $env{'form.folder'} eq 'supplemental') {
+ $folderpath='default&'.
+ &escape(&mt('Main '.$crstype.' Documents'));
+ }
+ }
+ $containertag = '';
+ $uploadtag = '';
}
if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) {
$showdoc='/'.$1;
@@ -3013,18 +3026,6 @@ ERFORM
'sl' => 'Show Log'
);
- my $folderpath=$env{'form.folderpath'};
- if (!$folderpath) {
- if ($env{'form.folder'} eq '' ||
- $env{'form.folder'} eq 'supplemental') {
- $folderpath='default&'.
- &escape(&mt('Main '.$crstype.' Documents'));
- }
- }
- unless ($env{'form.pagepath'}) {
- $containertag = '';
- $uploadtag = '';
- }
$r->print(<
@@ -3062,7 +3063,6 @@ HIDDENFORM
}
}
$r->print(''.$tabtitles{'main'}{$crstype}.'');
$active = '';
if (!$forcestandard || ($env{'form.folderpath'}=~/^supplemental/)) {
@@ -3071,7 +3071,6 @@ HIDDENFORM
}
}
$r->print(''.$tabtitles{'supplemental'}{$crstype}.'');
$r->print('');
} else {
@@ -3277,9 +3276,13 @@ NGFFORM
{'
'=>$newpageform},
{'
'=>$newsylform},
{'
'=>$newgroupfileform},
- );
-
- }
+ );
+
+ my @importdoc = (
+ {'
'=>$extresourcesform},
+ {'
'=>$imspform},);
+ $fileuploadform = create_form_ul(create_list_elements(@importdoc)) . '
' . $fileuploadform;
+
push @specialdocumentsforma, ({'
'=>$newnavform},
{'
'=>$newsmppageform},
{'
'=>$newsmpproblemform},
@@ -3291,6 +3294,7 @@ NGFFORM
{'
'=>$newrosterform},);
$specialdocumentsform = create_form_ul(create_list_elements(@specialdocumentsforma));
+ }
if($env{'form.pagepath'}) {
@@ -3307,18 +3311,16 @@ my @tools = (
{'
'=>$recoverform},
);
-my @importdoc = (
- {'
'=>$extresourcesform},
- {'
'=>$imspform},
-);
-$fileuploadform = create_form_ul(create_list_elements(@importdoc)) . '
' . $fileuploadform;
my %orderhash = (
- '00' => ['Newfolder',$newfolderform],
'aa' => ['Import Documents',$fileuploadform],
'bb' => ['Published Resources',$simpleeditdefaultform],
'cc' => ['Special Documents',$specialdocumentsform],
- 'dd' => ['Tools', create_form_ul(create_list_elements(@tools)).&generate_admin_options($containertag,$uploadtag,\%help,\%env)],
+ 'dd' => ['Tools', create_form_ul(create_list_elements(@tools)).&generate_admin_options(\%help,\%env)],
);
+unless($env{'form.pagepath'}) {
+ $orderhash{'00'} = ['Newfolder',$newfolderform];
+}
+
my $tid='1';
$hadchanges=0;
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype);
@@ -3334,8 +3336,6 @@ $r->print(&generate_edit_table($tid,\%or
$r->print('');
}
- if ($env{'form.pagepath'}) {
- }
# ----------------------------------------------------- Supplemental documents
$active = 'style="display: none;"';
if($activeClass == 1){
@@ -3482,8 +3482,8 @@ $r->print('');
}
sub generate_admin_options {
- my ($containertag,$uploadtag,$help_ref,$env_ref) = @_;
- my %lt=&Apache::lonlocal::texthash(
+ my ($help_ref,$env_ref) = @_;
+ my %lt=&Apache::lonlocal::texthash(
'vc' => 'Verify Content',
'cv' => 'Check/Set Resource Versions',
'ls' => 'List Symbs',
@@ -3589,6 +3589,18 @@ sub editing_js {
p_ctr2b => '?[_98]'
);
+ my $crstype = &Apache::loncommon::course_type();
+ my $docs_folderpath = &HTML::Entities::encode($env{'environment.internal.'.$env{'request.course.id'}.'.docs_folderpath.folderpath'},'<>&"');
+ my $docs_pagepath = &HTML::Entities::encode($env{'environment.internal.'.$env{'request.course.id'}.'.docs_folderpath.pagepath'},'<>&"');
+ my $main_container_page;
+ if ($docs_folderpath eq '') {
+ if ($docs_pagepath ne '') {
+ $main_container_page = 1;
+ }
+ }
+ my $toplevelmain = 'default&Main%20'.$crstype.'%20Documents';
+ my $toplevelsupp = 'supplemental&Supplemental%20'.$crstype.'%20Documents';
+
return <