--- loncom/interface/londocs.pm 2008/12/19 18:57:43 1.325 +++ loncom/interface/londocs.pm 2009/01/28 18:10:04 1.329 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.325 2008/12/19 18:57:43 raeburn Exp $ +# $Id: londocs.pm,v 1.329 2009/01/28 18:10:04 droeschl 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'); } @@ -2522,6 +2518,7 @@ sub handler { return OK if $r->header_only; my $type = &Apache::loncommon::course_type(); + # --------------------------------------------- Initialize help topics for this foreach my $topic ('Adding_Course_Doc','Main_Course_Documents', 'Adding_External_Resource','Navigate_Content', @@ -2575,6 +2572,8 @@ sub handler { my $showdoc=0; my $containertag; my $uploadtag; + + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['folderpath','pagepath', 'pagesymb']); @@ -2747,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', @@ -2775,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'}? + + --> + +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', @@ -2801,41 +2872,7 @@ sub handler { $containertag = ''; $uploadtag = ''; } - - $r->print(< - - - - - $containertag - -
- - $uploadtag -
-
-
- -
- $help{'Verify_Content'} -
-
- $help{'Check_Resource_Versions'} -
- $dumpbut - $exportbut -
- -
-
- - -
-
-
-
 
-ENDCOURSEVERIFY + $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))); } @@ -2878,219 +2915,250 @@ 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{'nd'}
  • +
  • $lt{'pm'}
  • +
  • $lt{'pubd'}
  • +
  • $lt{'sd'}
  • +
  • $lt{'mo'}
  • +
  • $lt{'hao'}
  • + + - +'."\n". @@ -3121,71 +3189,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{'nd'}
    • +
    • $lt{'sd'}
    • +
    • $lt{'hao'}
    • +
    +
    -$lt{'file'}:
    -
    - -
    -$lt{'title'}:
    - -$uploadtag - -
    - - - -
    -
    - - - $help{'Uploading_From_Harddrive'} - -
    +$fileuploadform
    -
    -$lt{'pubd'}
    -$uploadtag - -
    - - -$help{'Importing_LON-CAPA_Resource'} - -
    - +$simpleeditdefaultform
    -

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

    -
    -
    -
    - -
    +$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'},'<>&"'); + + + + 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 + + $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'} - -
    +
    +$newfolderform +
    +$newpageform +
    +$newsylform +
    +$newnavform +
    +$newsmppageform +
    +$newsmpproblemform +
    +$newdropboxform +
    +$newexuploadform +
    +$newbulform +
    +$newaboutmeform +
    +$newaboutsomeoneform +
    +$newgroupfileform +
    +$newrosterform ENDFORM } if ($env{'form.pagepath'}) { $r->print(< -$uploadtag - - -$help{'Simple Problem'} - - -
    -$uploadtag - - - -$help{'Score_Upload_Form'} - -
    +$newsmpproblemform +
    +$newexuploadform ENDBLOCK } $r->print('
    $lt{'upls'}$lt{'spec'}
    + -
    -
    - +$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 @@ -3215,6 +3308,73 @@ 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 ($optionhash_ref,$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}).'
    • '; + } + } + foreach my $field (keys(%optionhash)){ + $form .= '
      '.$optionhash{$field}.'
      '; + } + $form .= '

    '; + return $form; +} sub editing_js { my ($udom,$uname) = @_; @@ -3417,6 +3577,7 @@ function markcopy(folderpath,index,oldti this.document.forms.renameform.submit(); } + ENDNEWSCRIPT } 1;