--- loncom/interface/londocs.pm 2009/05/21 02:47:48 1.325.2.1 +++ loncom/interface/londocs.pm 2009/01/30 09:05:36 1.330 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.325.2.1 2009/05/21 02:47:48 raeburn Exp $ +# $Id: londocs.pm,v 1.330 2009/01/30 09:05:36 tempelho Exp $ # # Copyright Michigan State University Board of Trustees # @@ -59,7 +59,6 @@ my $hadchanges; my %help=(); - sub mapread { my ($coursenum,$coursedom,$map)=@_; return @@ -120,11 +119,9 @@ sub dumpbutton { my $type = &Apache::loncommon::course_type(); if ($home+$other==0) { return ''; } if ($home) { - return '
'. - ''. - &Apache::loncommon::help_open_topic('Docs_Dump_Course_Docs'). - '
'; + &Apache::loncommon::help_open_topic('Docs_Dump_Course_Docs'); } else { return '
'. &mt('Dump '.$type. @@ -265,10 +262,9 @@ sub dumpcourse { sub exportbutton { my $type = &Apache::loncommon::course_type(); - return '
'. - ''. - &Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').'
'; + &Apache::loncommon::help_open_topic('Docs_Export_Course_Docs'); } @@ -401,10 +397,10 @@ sub exportcourse { $display .= ''."\n"; } if ($curRes->is_sequence()) { - $display .= ' '."\n"; + $display .= ' '."\n"; $lastcontainer = $count + $startcount + $boards; } elsif ($curRes->is_page()) { - $display .= ' '."\n"; + $display .= ' '."\n"; $lastcontainer = $count + $startcount + $boards; } my $currelem = $count+$boards+$startcount; @@ -478,7 +474,7 @@ function containerCheck(item) { $scripttag)); $r->print(&Apache::lonhtmlcommon::breadcrumbs('Export '.lc($type).' to IMS content package')); $r->print($display.''. - '

'. + '

'. '

'); } @@ -1227,7 +1223,7 @@ sub update_paste_buffer { &Apache::lonnet::appenv({'docs.markedcopy_supplemental' => $title}); ($title) = &parse_supplemental_title($title); } elsif ($env{'docs.markedcopy_supplemental'}) { - &Apache::lonnet::delenv('docs.markedcopy_supplemental'); + &Apache::lonnet::delenv('docs\\.markedcopy_supplemental'); } $url=~s{http(:|:)//https(:|:)//}{https$2//}; @@ -1331,7 +1327,7 @@ sub do_paste_from_buffer { } # published maps can only exists once, so remove it from paste buffer when done if (($url=~/\.(page|sequence)$/) && ($url=~m {^/res/})) { - &Apache::lonnet::delenv('docs.markedcopy'); + &Apache::lonnet::delenv('docs\\.markedcopy'); } if ($url=~ m{/smppg$}) { my $db_name = &Apache::lonsimplepage::get_db_name($url); @@ -1779,7 +1775,7 @@ sub entryline { ' +FIUP + + my $checkbox=(<$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', @@ -2802,41 +2872,8 @@ sub handler { $containertag = ''; $uploadtag = ''; } - - $r->print(< - - - - - $containertag - -
- - $uploadtag -
-
-
- -
- $help{'Verify_Content'} -
-
- $help{'Check_Resource_Versions'} -
- $dumpbut - $exportbut -
- -
-
- - -
-
-
-
 
-ENDCOURSEVERIFY + ##############alter hashaufruf + $r->print(&generate_admin_options($containertag,$uploadtag,\%lt,\%help,\%env)); $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc', &mt('Editing the Table of Contents for your '.$type))); } @@ -2879,223 +2916,264 @@ ENDCOURSEVERIFY $container='page'; } my $readfile='/uploaded/'.$coursedom.'/'.$coursenum.'/'.$folder.'.'.$container; + + + + 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 + $r->print(< - + -$lt{'file'}:
-
- -
-$lt{'title'}:
- -$uploadtag - -
- - - -
-
- - - $help{'Uploading_From_Harddrive'} - -
+$fileuploadform -
-$lt{'pubd'}
-$uploadtag - -
- - -$help{'Importing_LON-CAPA_Resource'} - -
- -
-

-$lt{'copm'}
-
- -$help{'Load_Map'} -

-
+$simpleeditdefaultform
-
- -
+$recoverform ENDFORM unless ($env{'form.pagepath'}) { $r->print(< -
-$uploadtag - - - $help{'Adding_External_Resource'} - -
-
- - -
+$extresourcesform +
+$imspform ENDFORM } $r->print(''); unless ($env{'form.pagepath'}) { my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"'); - $r->print(<
- - - -$help{'Adding_Folders'} - -
-
- - - -$help{'Adding_Pages'} - -
-
-$uploadtag - - - - $help{'Syllabus'} - -
-
-$uploadtag - - - -$help{'Navigate_Content'} - -
-
-$uploadtag - - - $help{'Simple Page'} - -
-
-$uploadtag - - -$help{'Simple Problem'} - -
-
-$uploadtag - - - - -
-
-$uploadtag - - - -$help{'Score_Upload_Form'} - -
-
-$uploadtag - - - -$help{'Bulletin Board'} - -
-
-$uploadtag - - - -$help{'My Personal Info'} - -
-
-$uploadtag - - - - -
-
-$uploadtag - - - -$help{'Group Files'} - -
-
-$uploadtag - - - -$help{'Course Roster'} - -
+ + + + 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 ENDFORM - } + +$r->print($specialdocumentsform); +my %orderhash = ( + 'aa_eins' => 'New Document', + 'bb_zwei' => 'Published Documents', + 'cc_drei' => 'Special Documents', + 'dd_vier' => 'More Options', + 'zz_hide' => 'Hide all Option', + ); +my %namehash = ( + 'New Document' => $fileuploadform, + 'Published Documents' => $simpleeditdefaultform, + 'Special Documents' => $specialdocumentsform, + 'More Options' => $extresourcesform.'
'.$imspform.'
'.$recoverform, + 'drei' => 'dr', + ); +$r->print(&generate_edit_table(\%namehash,\%orderhash)); + } if ($env{'form.pagepath'}) { $r->print(< -$uploadtag - - -$help{'Simple Problem'} - - -
-$uploadtag - - - -$help{'Score_Upload_Form'} - -
+$newsmpproblemform +
+$newexuploadform ENDBLOCK } $r->print(''."\n". ''); +#$r->print(&generate_edit_table(\%namehash,\%orderhash)); $r->print(''); } # ----------------------------------------------------- Supplemental documents @@ -3122,71 +3200,96 @@ ENDBLOCK '.sequence'; my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"'); + + my $supupdocform=(< + $fileupload +
+
+ + $checkbox + +

+ $lt{'comment'}:
+ +
+ + + + + $help{'Uploading_From_Harddrive'} + + +SUPDOCFORM + + my $supnewfolderform=(< + + + + $help{'Adding_Folders'} + + +SNFFORM + + + my $supnewextform=(< + + + + $help{'Adding_External_Resource'} + + +SNEFORM + + my $supnewsylform=(< + + + + + $help{'Syllabus'} + + +SNSFORM + + my $supnewaboutmeform=(< + + + + + $help{'My Personal Info'} + + +SNAMFORM + $r->print(< -$lt{'upls'} -$lt{'spec'} - +
    +
  • $lt{'nd'}
  • +
  • $lt{'sd'}
  • +
  • $lt{'hao'}
  • +
+ + -
-
- +$supupdocform +
+$supnewfolderform
+$supnewextform
- - - -

-$lt{'comment'}:
- +$supnewsylform
- - - - - $help{'Uploading_From_Harddrive'} - - -
-
- - - - $help{'Adding_Folders'} - -
-
- - - - $help{'Adding_External_Resource'} - -
-
- - - - -$help{'Syllabus'} - -
-
- - - - -$help{'My Personal Info'} - -
+$supnewaboutmeform
ENDSUPFORM @@ -3202,6 +3305,7 @@ ENDSUPFORM '); } + } else { unless ($upload_result eq 'phasetwo') { # -------------------------------------------------------- This is showdoc mode @@ -3216,6 +3320,76 @@ ENDSUPFORM return OK; } +sub generate_admin_options { + my ($containertag,$uploadtag,$lt_ref,$help_ref,$env_ref) = @_; + my %lt = %{$lt_ref}; + my %help = %{$help_ref}; + my %env = %{$env_ref}; + my $dumpbut=&dumpbutton(); + my $exportbut=&exportbutton(); + return (< + + + + + $containertag + +
+ + $uploadtag +
+
+
    +
  • + $help{'Verify_Content'} +
  • +
  • + $help{'Check_Resource_Versions'} +
  • +
  • + $dumpbut +
  • +
  • + $exportbut +
  • +
  • + +
  • +
  • + + +
  • +
+
+
 
+ENDOPTIONFORM + +} + + +sub generate_edit_table { + my ($namehash_ref,$orderhash_ref) = @_; + #my %optionhash = %{$optionhash_ref}; #id verlinkt mit inhalt + my %namehash = %{$namehash_ref}; #name verlinkt mit id + my %orderhash = %{$orderhash_ref}; #name mit kürzel verlinkt mit name + my $form; + $form = '

'.&mt('Upload Course Documents').'

'; + $form .= '
    '; + foreach my $name (sort(keys(%orderhash))){ + if($name eq 'zz_hide'){ + $form .= '
  • '.&mt($orderhash{$name}).'
  • '; + }else{ + $form .= '
  • '.&mt($orderhash{$name}).'
  • '; + } + } + $form .= '
    '; + foreach my $field (keys(%namehash)){ + $form .= ''; + } + $form .= '
'; + return $form; +} sub editing_js { my ($udom,$uname) = @_; @@ -3226,10 +3400,10 @@ sub editing_js { p_mnp => 'Name of New Page', t_mnp => 'New Page', p_mxu => 'Title for the Uploaded Score', - p_msp => 'Name of the Simple Course Page', + p_msp => 'Title for the Page', p_msb => 'Title for the Problem', p_mdb => 'Title for the Drop Box', - p_mbb => 'Title for the Discussion Board', + p_mbb => 'Title for the Bulletin Board', p_mab => "Enter user:domain for User's 'About Me' Page", p_mab2 => "About [_99]", p_mab_alrt1 => 'Not a valid user:domain', @@ -3418,6 +3592,22 @@ function markcopy(folderpath,index,oldti this.document.forms.renameform.submit(); } +function hideAll() { + currentData = document.getElementById('content'); + currentDivs = currentData.getElementsByTagName('div'); + for (i = 0; i < currentDivs.length; i++) { + currentDivs[i].style.display = 'none'; + } +} + +function showPage(current, pageId) { + hideAll(); + current.className = 'active'; + currentData = document.getElementById(pageId); + currentData.style.display = 'block'; + return false; +} + ENDNEWSCRIPT } 1;