--- loncom/interface/londocs.pm 2010/07/05 12:29:36 1.429 +++ loncom/interface/londocs.pm 2010/08/16 03:49:33 1.434 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.429 2010/07/05 12:29:36 droeschl Exp $ +# $Id: londocs.pm,v 1.434 2010/08/16 03:49:33 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1607,13 +1607,12 @@ sub editor { my $shown=0; if (($ishidden) || ($isencrypted) || ($randompick>=0) || ($is_random_order)) { $r->print('
'. - '

'.&mt('Parameters:'). - '

'); + ''); if ($randompick>=0) { $r->print('

' .&mt('Caution: this folder is set to randomly pick a subset' @@ -2719,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; @@ -3014,18 +3026,6 @@ ERFORM 'sl' => '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(< @@ -3278,9 +3278,13 @@ NGFFORM {''.$lt{newp}.''=>$newpageform}, {''.$lt{syll}.''=>$newsylform}, {''.$lt{grpo}.''=>$newgroupfileform}, - ); - - } + ); + + my @importdoc = ( + {''.$lt{extr}.''=>$extresourcesform}, + {''.$lt{imsf}.''=>$imspform},); + $fileuploadform = create_form_ul(create_list_elements(@importdoc)) . '


' . $fileuploadform; + push @specialdocumentsforma, ({''.$lt{navc}.''=>$newnavform}, {''.$lt{sipa}.''=>$newsmppageform}, {''.$lt{sipr}.''=>$newsmpproblemform}, @@ -3292,6 +3296,7 @@ NGFFORM {''.$lt{rost}.''=>$newrosterform},); $specialdocumentsform = create_form_ul(create_list_elements(@specialdocumentsforma)); + } if($env{'form.pagepath'}) { @@ -3308,18 +3313,16 @@ my @tools = ( {''.$lt{reco}.''=>$recoverform}, ); -my @importdoc = ( - {''.$lt{extr}.''=>$extresourcesform}, - {''.$lt{imsf}.''=>$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); @@ -3335,8 +3338,6 @@ $r->print(&generate_edit_table($tid,\%or $r->print('
'); } - if ($env{'form.pagepath'}) { - } # ----------------------------------------------------- Supplemental documents $active = 'style="display: none;"'; if($activeClass == 1){ @@ -3483,8 +3484,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', @@ -3505,7 +3506,7 @@ sub generate_admin_options { if($dumpbut ne ''){ push @list, {''.$lt{dcd}.''=>$dumpbut}; } - push @list, ({''.$lt{imse}.'' + push @list, ({''.$lt{imse}.'' =>$exportbut}, {''.$lt{ls}.'' =>"$lt{'ls'}"}, @@ -3590,6 +3591,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 <