'.
&Apache::lonnet::gettitle($linkurl).
@@ -2452,14 +2518,15 @@ sub handler {
return OK if $r->header_only;
my $type = &Apache::loncommon::course_type();
+
# --------------------------------------------- Initialize help topics for this
- foreach ('Adding_Course_Doc','Main_Course_Documents',
- 'Adding_External_Resource','Navigate_Content',
- 'Adding_Folders','Docs_Overview', 'Load_Map',
- 'Supplemental','Score_Upload_Form','Adding_Pages',
- 'Importing_LON-CAPA_Resource','Uploading_From_Harddrive',
- 'Check_Resource_Versions','Verify_Content') {
- $help{$_}=&Apache::loncommon::help_open_topic('Docs_'.$_);
+ foreach my $topic ('Adding_Course_Doc','Main_Course_Documents',
+ 'Adding_External_Resource','Navigate_Content',
+ 'Adding_Folders','Docs_Overview', 'Load_Map',
+ 'Supplemental','Score_Upload_Form','Adding_Pages',
+ 'Importing_LON-CAPA_Resource','Uploading_From_Harddrive',
+ 'Check_Resource_Versions','Verify_Content') {
+ $help{$topic}=&Apache::loncommon::help_open_topic('Docs_'.$topic);
}
# Composite help files
$help{'Syllabus'} = &Apache::loncommon::help_open_topic(
@@ -2505,6 +2572,8 @@ sub handler {
my $showdoc=0;
my $containertag;
my $uploadtag;
+
+
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
['folderpath','pagepath',
'pagesymb']);
@@ -2578,9 +2647,10 @@ sub handler {
}
# -------------------------------------------------------------------- Body tag
$script = '';
- my @brcrum = [{href=>"/adm/createuser",text=>"$type Documents"}];
+ my $brcrum = [{href=>"/adm/createuser",text=>"$type Documents"}];
$r->print(&Apache::loncommon::start_page("$type Documents", $script,
- {'force_register' => $showdoc, bread_crumbs => @brcrum}).
+ {'force_register' => $showdoc,
+ 'bread_crumbs' => $brcrum}).
&Apache::loncommon::help_open_menu('','',273,'RAT'));
my %allfiles = ();
@@ -2619,12 +2689,12 @@ sub handler {
}
my @attributes = ();
if ($env{'form.embedded_attrib_'.$i} =~ /:/) {
- @attributes = split/:/,$env{'form.embedded_attrib_'.$i};
+ @attributes = split(/:/,$env{'form.embedded_attrib_'.$i});
} else {
@attributes = ($env{'form.embedded_attrib_'.$i});
}
- foreach (@attributes) {
- push(@{$attribs{$i}},&unescape($_));
+ foreach my $attr (@attributes) {
+ push(@{$attribs{$i}},&unescape($attr));
}
if ($javacodebase) {
$codebase{$i} = $javacodebase;
@@ -2642,7 +2712,7 @@ sub handler {
my $updateflag = 0;
my $getstatus = &Apache::lonnet::getuploaded('GET',$primary_url,$coursedom,$coursenum,\$content,\$rtncode);
if ($getstatus eq 'ok') {
- foreach my $item (keys %newname) {
+ foreach my $item (keys(%newname)) {
if ($newname{$item} ne $origname{$item}) {
my $attrib_regexp = '';
if (@{$attribs{$item}} > 1) {
@@ -2676,9 +2746,8 @@ sub handler {
'uplm' => 'Upload a new main '.lc($type).' document',
'upls' => 'Upload a new supplemental '.lc($type).' document',
'impp' => 'Import a document',
- 'pubd' => 'Published documents',
+ 'pubd' => 'Published Documents',
'copm' => 'All documents out of a published map into this folder',
- 'spec' => 'Special documents',
'upld' => 'Upload Document',
'srch' => 'Search',
'impo' => 'Import',
@@ -2695,7 +2764,7 @@ sub handler {
'sipr' => 'Simple Problem',
'drbx' => 'Drop Box',
'scuf' => 'Score Upload Form',
- 'bull' => 'Bulletin Board',
+ 'bull' => 'Discussion Board',
'mypi' => 'My Personal Info',
'grpo' => 'Group Files',
'rost' => 'Course Roster',
@@ -2704,13 +2773,86 @@ sub handler {
'file' => 'File',
'title' => 'Title',
'comment' => 'Comment',
- 'parse' => 'If HTML file, upload embedded images/multimedia files'
+ 'parse' => 'Upload embedded images/multimedia files if HTML file!',
+ 'nd' => 'New Document',
+ 'pm' => 'Published Map',
+ 'sd' => 'Special Document',
+ 'mo' => 'More Options',
+ 'hao' => 'Hide all Options'
);
# -----------------------------------------------------------------------------
+ my $fileupload=(<
+
+FIUP
+
+ my $checkbox=(<$lt{'parse'}?
+
+ -->
+
+ $lt{'parse'}
+
+CHBO
+
+ my $fileuploadform=(<
+ $fileupload
+
+ $lt{'title'}:
+
+ $uploadtag
+
+
+
+ $checkbox
+
+
+
+
+
+ $help{'Uploading_From_Harddrive'}
+
+
+FUFORM
+
+ my $simpleeditdefaultform=(<
+ $lt{'pubd'}
+ $uploadtag
+
+
+
+
+ $help{'Importing_LON-CAPA_Resource'}
+
+
+
+
+
+ $lt{'copm'}
+
+
+ $help{'Load_Map'}
+
+
+SEDFFORM
+
+ my $extresourcesform=(<
+ $uploadtag
+
+
+ $help{'Adding_External_Resource'}
+
+
+ERFORM
+
if ($allowed) {
&update_paste_buffer($coursenum,$coursedom);
- my $dumpbut=&dumpbutton();
- my $exportbut=&exportbutton();
my %lt=&Apache::lonlocal::texthash(
'vc' => 'Verify Content',
'cv' => 'Check/Set Resource Versions',
@@ -2730,51 +2872,49 @@ sub handler {
$containertag = ' ';
$uploadtag = ' ';
}
-
- $r->print(<
-
-
-
-
- $containertag
-
-
-
-
-ENDCOURSEVERIFY
- $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',
- &mt('Editing the Table of Contents for your '.$type)));
+ $r->print(<
+
+
+
+
+ $containertag
+
+
+HIDDENFORM
+ }
+# --------------------------------------------------------- Main tab structure
+ my $activeClass = 1;
+ $r->print('');
+ if (($standard) && ($allowed) && (!$forcesupplement)) {
+ my $active = '';
+ if($activeClass == 1){
+ $active = 'class="active"';
+ $activeClass = 0;
+ }
+ $r->print(''.&mt('Main Course Documents').' ');
}
+ if (!$forcestandard) {
+ my $active = '';
+ if($activeClass == 1){
+ $active = 'class="active"';
+ }
+ $r->print(''.&mt('Supplemental Course Documents').' ');
+ }
+ $r->print(''.&mt('Special Admin Options').' ');
+ $r->print(' ');
# --------------------------------------------------------- Standard documents
- $r->print('
');
-
if (($standard) && ($allowed) && (!$forcesupplement)) {
- $r->print('');
-# ''.&mt('Main Course Documents').
-# ($allowed?' '.$help{'Main_Course_Documents'}:'').' ');
+ 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)));
my $folder=$env{'form.folder'};
if ($folder eq '' || $folder eq 'supplemental') {
$folder='default';
@@ -2789,13 +2929,8 @@ ENDCOURSEVERIFY
#$postexec='self.close();';
}
$hadchanges=0;
- my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,
- $upload_output,$type);
- if ($error) {
- $r->print('
'.$error.'
');
- }
if ($hadchanges) {
- &mark_hash_old()
+ &mark_hash_old();
}
&changewarning($r,$postexec);
my $folderseq='/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time.
@@ -2807,230 +2942,230 @@ ENDCOURSEVERIFY
$container='page';
}
my $readfile='/uploaded/'.$coursedom.'/'.$coursenum.'/'.$folder.'.'.$container;
- $r->print(<
-
-$lt{'uplm'}
-$lt{'impp'}
-$lt{'spec'}
-
-
-
-$lt{'file'}:
-
-
-
-
-
-
-ENDFORM
- unless ($env{'form.pagepath'}) {
- $r->print(<
-
-
-ENDFORM
- }
- $r->print(' ');
+
+
+
+ my $recoverform=(<
+
+
+RFORM
+
+ my $imspform=(<
+
+
+
+IMSPFORM
+
+ my $newnavform=(<
+ $uploadtag
+
+
+
+ $help{'Navigate_Content'}
+
+
+NNFORM
+ my $newsmppageform=(<
+ $uploadtag
+
+
+ $help{'Simple Page'}
+
+
+NSPFORM
+
+ my $newsmpproblemform=(<
+ $uploadtag
+
+
+ $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 Info'}
+
+
+NAMFORM
+
+ my $newaboutsomeoneform=(<
+ $uploadtag
+
+
+
+
+
+NASOFORM
+
+
+ my $newrosterform=(<
+ $uploadtag
+
+
+
+ $help{'Course Roster'}
+
+
+NROSTFORM
+
unless ($env{'form.pagepath'}) {
my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
- $r->print(<
-
-
-
-
-
-
-
-
-
-
-
-
-ENDFORM
+
+ my $newpageform=(<
+
+
+
+ $help{'Adding_Pages'}
+
+
+NPFORM
+
+ my $newfolderform=(<
+
+
+
+ $help{'Adding_Folders'}
+
+
+NFFORM
+
+ my $newsylform=(<
+ $uploadtag
+
+
+
+ $help{'Syllabus'}
+
+
+NSYLFORM
+
+ my $newgroupfileform=(<
+ $uploadtag
+
+
+
+ $help{'Group Files'}
+
+
+NGFFORM
+
+
+ my $specialdocumentsform=(< $newfolderform
+ $newpageform
+ $newsylform
+ $newnavform
+ $newsmppageform
+ $newsmpproblemform
+ $newdropboxform
+ $newexuploadform
+ $newbulform
+ $newaboutmeform
+ $newaboutsomeoneform
+ $newgroupfileform
+ $newrosterform
+SPDOFORM
+
+
+my %orderhash = (
+ 'aa' => 'New Document',
+ 'bb' => 'Published Documents',
+ 'cc' => 'Special Documents',
+ 'dd' => 'More Options',
+ 'zz' => 'Hide all Options',
+ );
+my %namehash = (
+ 'New Document' => $fileuploadform,
+ 'Published Documents' => $simpleeditdefaultform,
+ 'Special Documents' => $specialdocumentsform,
+ 'More Options' => $extresourcesform.' '.$imspform.' '.$recoverform,
+ );
+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));
+my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
+ if ($error) {
+ $r->print(''.$error.'
');
}
+$r->print('');
+ }
if ($env{'form.pagepath'}) {
- $r->print(<
-$uploadtag
-
-
- $help{'Simple Problem'}
-
-
-
-ENDBLOCK
}
- $r->print(' '."\n".
-'
');
- $r->print('
');
}
# ----------------------------------------------------- Supplemental documents
if (!$forcestandard) {
- $r->print('