--- loncom/interface/londocs.pm 2010/08/14 04:28:21 1.432
+++ loncom/interface/londocs.pm 2010/10/27 01:00:38 1.439
@@ -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.439 2010/10/27 01:00:38 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1720,7 +1720,7 @@ sub process_file_upload {
# probably the only place in the system where this should be "1"
my $newidx=&LONCAPA::map::getresidx();
$destination .= $newidx;
- my $url=&Apache::lonnet::userfileupload('uploaddoc',1,$destination,
+ my $url=&Apache::lonnet::userfileupload('uploaddoc','coursedoc',$destination,
$parseaction,$allfiles,
$codebase);
my $ext='false';
@@ -1781,7 +1781,7 @@ sub process_secondary_uploads {
}
$destination .= $newidx;
my ($url,$filename);
- $url=&Apache::lonnet::userfileupload($formname.$num,1,$destination);
+ $url=&Apache::lonnet::userfileupload($formname.$num,'coursedoc',$destination);
($filename) = ($url =~ m{^/uploaded/\Q$coursedom\E/\Q$coursenum\E/\Q$destination\E/(.+)$});
return $filename;
}
@@ -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;
@@ -2907,7 +2920,7 @@ sub create_form_ul {
'upld' => 'Import Document',
'srch' => 'Search',
'impo' => 'Import',
- 'book' => 'Import Bookmarks',
+ 'wish' => 'Import from Wishlist',
'selm' => 'Select Map',
'load' => 'Load Map',
'reco' => 'Recover Deleted Documents',
@@ -2958,7 +2971,7 @@ CHBO
$fileupload
$lt{'title'}:
-
+
$uploadtag
@@ -2980,7 +2993,7 @@ SEDFFORM
my @simpleeditdefaultforma = (
{ '
' => "$uploadtag" },
{ '
' => "$help{'Importing_LON-CAPA_Resource'}" },
- { '
' => "" },
+ { '
' => "" },
);
$simpleeditdefaultform .= create_form_ul(create_list_elements(@simpleeditdefaultforma));
$simpleeditdefaultform .=(< '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 {
@@ -3120,7 +3119,7 @@ HIDDENFORM
my $recoverform=(<
-
+
RFORM
@@ -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'}) {
@@ -3304,21 +3308,19 @@ if($env{'form.pagepath'}) {
my @tools = (
# {'
'=>$extresourcesform},
# {'
'=>$imspform},
- {'
'=>$recoverform},
+ {'
'=>$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 <