');
-# --------------------------------------------------------- Standard documents
- if (($standard) && ($allowed) && (!$forcesupplement)) {
- my $active = 'style="display: none;"';
- if($activeClass == 0){
- $active = 'style="display: block;"';
- }
- $r->print('
');
- $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',
- &mt('Editing the Table of Contents for your '.$type)));
+
+# Generate the tabs
+ my $mode;
+ if (($supplementalflag) && (!$allowed)) {
+ &Apache::lonnavdisplay::startContentScreen($r,'supplemental');
+ } else {
+ &startContentScreen($r,($supplementalflag?'suppdocs':'docs'));
+ }
+
+#
+
+ my $savefolderpath;
+
+ if ($allowed) {
my $folder=$env{'form.folder'};
- if ($folder eq '' || $folder eq 'supplemental') {
+ if ($folder eq '' || $supplementalflag) {
$folder='default';
- $env{'form.folderpath'}='default&'.&escape(&mt('Main '.$type.' Documents'));
+ $savefolderpath = $env{'form.folderpath'};
+ $env{'form.folderpath'}='default&'.&escape(&mt('Content'));
$uploadtag = '
';
}
my $postexec='';
if ($folder eq 'default') {
- $r->print('');
+ $r->print(''."\n"
+ );
} else {
#$postexec='self.close();';
}
@@ -2942,235 +2562,241 @@ HIDDENFORM
my $recoverform=(<
-
+
RFORM
my $imspform=(<
-
+
IMSPFORM
my $newnavform=(<
+
$uploadtag
-
-
+
$help{'Navigate_Content'}
-
NNFORM
my $newsmppageform=(<
+
$uploadtag
-
- $help{'Simple Page'}
-
+
+ $help{'Simple Page'}
NSPFORM
my $newsmpproblemform=(<
+
$uploadtag
-
- $help{'Simple Problem'}
-
+
+ $help{'Simple Problem'}
NSPROBFORM
my $newdropboxform=(<
+
$uploadtag
-
-
-
+
NDBFORM
my $newexuploadform=(<
+
$uploadtag
-
-
+
$help{'Score_Upload_Form'}
-
NEXUFORM
my $newbulform=(<
+
$uploadtag
-
-
+
$help{'Bulletin Board'}
-
NBFORM
my $newaboutmeform=(<
+
$uploadtag
-
-
+
$help{'My Personal Information Page'}
-
NAMFORM
my $newaboutsomeoneform=(<
+
$uploadtag
-
-
-
+
NASOFORM
my $newrosterform=(<
+
$uploadtag
-
-
+
$help{'Course Roster'}
-
NROSTFORM
my $specialdocumentsform;
+my @specialdocumentsforma;
+my $gradingform;
+my @gradingforma;
+my $communityform;
+my @communityforma;
my $newfolderform;
+my $newfolderb;
- unless ($env{'form.pagepath'}) {
- my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
-
+ my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
+
my $newpageform=(<
-
- $help{'Adding_Pages'}
-
+
+
+ $help{'Adding_Pages'}
NPFORM
+
$newfolderform=(<
-
- $help{'Adding_Folders'}
-
+
+ $lt{'newf'}$help{'Adding_Folders'}
NFFORM
my $newsylform=(<
+
$uploadtag
-
-
+
$help{'Syllabus'}
-
+
NSYLFORM
-
+
my $newgroupfileform=(<
+
$uploadtag
-
-
+
$help{'Group Portfolio'}
-
NGFFORM
+ @specialdocumentsforma=(
+ {''=>$newpageform},
+ {''=>$newsylform},
+ {''=>$newnavform},
+ {''=>$newsmppageform},
+ );
+ $specialdocumentsform = &create_form_ul(&create_list_elements(@specialdocumentsforma));
+
+
+ my @importdoc = (
+ {''=>$extresourcesform},
+ {''=>$imspform},);
+ $fileuploadform = &create_form_ul(&create_list_elements(@importdoc)) . '
' . $fileuploadform;
+
+ @gradingforma=(
+ {''=>$newsmpproblemform},
+ {''=>$newdropboxform},
+ {''=>$newexuploadform},
+
+ );
+ $gradingform = &create_form_ul(&create_list_elements(@gradingforma));
+
+ @communityforma=(
+ {''=>$newbulform},
+ {''=>$newaboutmeform},
+ {''=>$newaboutsomeoneform},
+ {''=>$newrosterform},
+ {''=>$newgroupfileform},
+ );
+ $communityform = &create_form_ul(&create_list_elements(@communityforma));
+
- $specialdocumentsform="
$newpageform
$newsylform
$newgroupfileform";
- }
- $specialdocumentsform.="
$newnavform
$newsmppageform
-
$newsmpproblemform
$newdropboxform
-
$newexuploadform
$newbulform
-
$newaboutmeform
$newaboutsomeoneform
-
$newrosterform";
-if($env{'form.pagepath'}) {
- $specialdocumentsform="
$newsmpproblemform
$newexuploadform";
-}
+
+my @tools = (
+# {''=>$extresourcesform},
+# {''=>$imspform},
+ {''=>$recoverform},
+ );
my %orderhash = (
- 'aa' => 'New Document',
- 'bb' => 'Published Documents',
- 'cc' => 'Special Documents',
- 'dd' => 'More Tools',
- 'zz' => 'Hide all Options',
- );
-my %namehash = (
- 'New Document' => $fileuploadform.'
'.$newfolderform,
- 'Published Documents' => $simpleeditdefaultform,
- 'Special Documents' => $specialdocumentsform,
- 'More Tools' => $extresourcesform.'
'.$imspform.'
'.$recoverform.'
'.&generate_admin_options($containertag,$uploadtag,\%help,\%env),
+ 'aa' => ['Import Documents',$fileuploadform],
+ 'bb' => ['Published Resources',$simpleeditdefaultform],
+ 'cc' => ['Grading Resources',$gradingform],
+ 'ff' => ['Tools', &create_form_ul(&create_list_elements(@tools)).&generate_admin_options(\%help,\%env)],
);
-my $tid='1';
-my $content='content';
-my $navigation='navigation';
-my $varcd = 'Main Course Documents';
-$r->print(&generate_edit_table($tid,$content,$navigation,$varcd,\%namehash,\%orderhash));
+unless ($env{'form.pagepath'}) {
+ $orderhash{'00'} = ['Newfolder',$newfolderform];
+ $orderhash{'dd'} = ['Community Resources',$communityform];
+ $orderhash{'ee'} = ['Special Documents',$specialdocumentsform];
+}
+
$hadchanges=0;
- my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
- if ($error) {
- $r->print(''.$error.'
');
- }
- if ($hadchanges) {
- &mark_hash_old();
- }
+ unless ($supplementalflag) {
+ my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype,
+ $supplementalflag,\%orderhash,$iconpath);
+ if ($error) {
+ $r->print(''.$error.'
');
+ }
+ if ($hadchanges) {
+ &mark_hash_old();
+ }
- &changewarning($r,'');
-$r->print('');
- if ($env{'form.pagepath'}) {
- }
+ &changewarning($r,'');
+ }
}
-# ----------------------------------------------------- Supplemental documents
- if (!$forcestandard) {
- my $active = 'style="display: none;"';
- if($activeClass == 1){
- $active = 'style="display: block;"';
- }
- $r->print('
');
+
+# Supplemental documents start here
+
my $folder=$env{'form.folder'};
- unless ($folder=~/^supplemental/) {
+ unless ($supplementalflag) {
$folder='supplemental';
}
if ($folder =~ /^supplemental$/ &&
(($env{'form.folderpath'} =~ /^default\&/) || ($env{'form.folderpath'} eq ''))) {
- $env{'form.folderpath'} = 'supplemental&'.
- &escape(&mt('Supplemental '.$type.' Documents'));
+ $env{'form.folderpath'} = &supplemental_base();
+ } elsif ($allowed) {
+ $env{'form.folderpath'} = $savefolderpath;
}
+ $env{'form.pagepath'} = '';
if ($allowed) {
my $folderseq=
'/uploaded/'.$coursedom.'/'.$coursenum.'/supplemental_'.time.
@@ -3178,8 +2804,10 @@ $r->print('
');
my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
+ my $supupdocformbtn = "